Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AdminGetFilestoresInfoResponse
- type AdminGetFilestoresInfoResponseStatus
- type AdminGetLicenseInfoParams
- type AdminGetLicenseInfoResponse
- type AdminGetLlamaextractFeaturesResponse
- type AdminGetLlamaextractFeaturesResponseAvailableMode
- type AdminGetLlamaextractFeaturesResponseSchemaGeneration
- type AdminGetLlmsInfoResponse
- type AdminGetLlmsInfoResponseLlmInfo
- type AdminGetOcrStatusResponse
- type AdminGetOcrStatusResponseStatus
- type AdminService
- func (r *AdminService) GetFilestoresInfo(ctx context.Context, opts ...option.RequestOption) (res *AdminGetFilestoresInfoResponse, err error)
- func (r *AdminService) GetLicenseInfo(ctx context.Context, query AdminGetLicenseInfoParams, ...) (res *AdminGetLicenseInfoResponse, err error)
- func (r *AdminService) GetLlamaextractFeatures(ctx context.Context, opts ...option.RequestOption) (res *AdminGetLlamaextractFeaturesResponse, err error)
- func (r *AdminService) GetLlmsInfo(ctx context.Context, opts ...option.RequestOption) (res *AdminGetLlmsInfoResponse, err error)
- func (r *AdminService) GetOcrStatus(ctx context.Context, opts ...option.RequestOption) (res *AdminGetOcrStatusResponse, err error)
- type AdminUsageMetricAggregateParams
- type AdminUsageMetricAggregateResponse
- type AdminUsageMetricAggregateResponseBucket
- type AdminUsageMetricAggregateResponseBucketTotalCreditsUnion
- func (u AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) AsFloat() (v float64)
- func (u AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) AsString() (v string)
- func (u AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) RawJSON() string
- func (r *AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) UnmarshalJSON(data []byte) error
- type AdminUsageMetricService
- type AdminUserService
- type AdminUserUpdateClaimsParams
- type AdminUserUpdateClaimsParamsSetClaims
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CustomClaims
- type Error
- type Invite
- type InviteAcceptResponse
- type InviteListMineParams
- type InviteService
- func (r *InviteService) Accept(ctx context.Context, inviteID string, opts ...option.RequestOption) (res *InviteAcceptResponse, err error)
- func (r *InviteService) Decline(ctx context.Context, inviteID string, opts ...option.RequestOption) (err error)
- func (r *InviteService) ListMine(ctx context.Context, query InviteListMineParams, opts ...option.RequestOption) (res *pagination.PaginatedCursor[Invite], err error)
- func (r *InviteService) ListMineAutoPaging(ctx context.Context, query InviteListMineParams, opts ...option.RequestOption) *pagination.PaginatedCursorAutoPager[Invite]
- type Organization
- type OrganizationGetUsageParams
- type OrganizationListParams
- type OrganizationMember
- type OrganizationNewParams
- type OrganizationRoleService
- type OrganizationService
- func (r *OrganizationService) Delete(ctx context.Context, organizationID string, opts ...option.RequestOption) (err error)
- func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *Organization, err error)
- func (r *OrganizationService) GetUsage(ctx context.Context, organizationID string, query OrganizationGetUsageParams, ...) (res *UsageAndPlan, err error)
- func (r *OrganizationService) List(ctx context.Context, query OrganizationListParams, ...) (res *pagination.PaginatedCursor[Organization], err error)
- func (r *OrganizationService) ListAutoPaging(ctx context.Context, query OrganizationListParams, ...) *pagination.PaginatedCursorAutoPager[Organization]
- func (r *OrganizationService) New(ctx context.Context, body OrganizationNewParams, opts ...option.RequestOption) (res *Organization, err error)
- func (r *OrganizationService) Update(ctx context.Context, organizationID string, body OrganizationUpdateParams, ...) (res *Organization, err error)
- type OrganizationUpdateParams
- type OrganizationUserAddParams
- type OrganizationUserAddParamsBody
- type OrganizationUserAddToProjectParams
- type OrganizationUserAddToProjectResponse
- type OrganizationUserAssignRoleParams
- type OrganizationUserDeleteParams
- type OrganizationUserListProjectsParams
- type OrganizationUserListProjectsResponse
- type OrganizationUserRemoveFromProjectParams
- type OrganizationUserRemoveFromProjectResponse
- type OrganizationUserService
- func (r *OrganizationUserService) Add(ctx context.Context, organizationID string, body OrganizationUserAddParams, ...) (res *[]OrganizationMember, err error)
- func (r *OrganizationUserService) AddToProject(ctx context.Context, userID string, params OrganizationUserAddToProjectParams, ...) (res *OrganizationUserAddToProjectResponse, err error)
- func (r *OrganizationUserService) AssignRole(ctx context.Context, organizationID string, ...) (res *UserOrganizationRole, err error)
- func (r *OrganizationUserService) Delete(ctx context.Context, memberUserID string, params OrganizationUserDeleteParams, ...) (err error)
- func (r *OrganizationUserService) ListMembers(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *[]OrganizationMember, err error)
- func (r *OrganizationUserService) ListProjects(ctx context.Context, userID string, query OrganizationUserListProjectsParams, ...) (res *[]OrganizationUserListProjectsResponse, err error)
- func (r *OrganizationUserService) RemoveFromProject(ctx context.Context, projectID string, ...) (res *OrganizationUserRemoveFromProjectResponse, err error)
- type Project
- type ProjectDeleteParams
- type ProjectGetParams
- type ProjectListParams
- type ProjectNewParams
- type ProjectService
- func (r *ProjectService) Delete(ctx context.Context, projectID string, body ProjectDeleteParams, ...) (err error)
- func (r *ProjectService) Get(ctx context.Context, projectID string, query ProjectGetParams, ...) (res *Project, err error)
- func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *pagination.PaginatedCursor[Project], err error)
- func (r *ProjectService) ListAutoPaging(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) *pagination.PaginatedCursorAutoPager[Project]
- func (r *ProjectService) New(ctx context.Context, params ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)
- func (r *ProjectService) Update(ctx context.Context, projectID string, params ProjectUpdateParams, ...) (res *Project, err error)
- type ProjectUpdateParams
- type Role
- type RolePermission
- type UsageAndPlan
- type UsageAndPlanPlan
- type UsageAndPlanPlanCurrentBillingPeriod
- type UsageAndPlanPlanLimits
- type UsageAndPlanPlanRecurringCredit
- type UsageAndPlanPlanRecurringCreditCreditType
- type UsageAndPlanUsage
- type UsageAndPlanUsageActiveFreeCreditsUsage
- type UserClaims
- type UserOrganizationRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (LLAMA_CLOUD_API_KEY, LLAMA_CLOUD_ADMIN_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AdminGetFilestoresInfoResponse ¶
type AdminGetFilestoresInfoResponse struct {
// Any of "missing_buckets", "missing_credentials", "ok".
Status AdminGetFilestoresInfoResponseStatus `json:"status" api:"required"`
AvailableBuckets map[string]string `json:"available_buckets"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
AvailableBuckets respjson.Field
UnavailableBuckets respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AdminGetFilestoresInfoResponse) RawJSON ¶
func (r AdminGetFilestoresInfoResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminGetFilestoresInfoResponse) UnmarshalJSON ¶
func (r *AdminGetFilestoresInfoResponse) UnmarshalJSON(data []byte) error
type AdminGetFilestoresInfoResponseStatus ¶
type AdminGetFilestoresInfoResponseStatus string
const ( AdminGetFilestoresInfoResponseStatusMissingBuckets AdminGetFilestoresInfoResponseStatus = "missing_buckets" AdminGetFilestoresInfoResponseStatusMissingCredentials AdminGetFilestoresInfoResponseStatus = "missing_credentials" AdminGetFilestoresInfoResponseStatusOk AdminGetFilestoresInfoResponseStatus = "ok" )
type AdminGetLicenseInfoParams ¶
type AdminGetLicenseInfoParams struct {
// Whether to include scopes in the response
IncludeScopes param.Opt[bool] `query:"include_scopes,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AdminGetLicenseInfoParams) URLQuery ¶
func (r AdminGetLicenseInfoParams) URLQuery() (v url.Values, err error)
URLQuery serializes AdminGetLicenseInfoParams's query parameters as `url.Values`.
type AdminGetLicenseInfoResponse ¶
type AdminGetLicenseInfoResponse struct {
// License expiration date
ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
// License validation status
Status string `json:"status" api:"required"`
// License message
Message string `json:"message" api:"nullable"`
// License scopes
Scopes []string `json:"scopes" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExpiresAt respjson.Field
Status respjson.Field
Message respjson.Field
Scopes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AdminGetLicenseInfoResponse) RawJSON ¶
func (r AdminGetLicenseInfoResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminGetLicenseInfoResponse) UnmarshalJSON ¶
func (r *AdminGetLicenseInfoResponse) UnmarshalJSON(data []byte) error
type AdminGetLlamaextractFeaturesResponse ¶
type AdminGetLlamaextractFeaturesResponse struct {
AvailableModes []AdminGetLlamaextractFeaturesResponseAvailableMode `json:"available_modes" api:"required"`
SchemaGeneration AdminGetLlamaextractFeaturesResponseSchemaGeneration `json:"schema_generation" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvailableModes respjson.Field
SchemaGeneration respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AdminGetLlamaextractFeaturesResponse) RawJSON ¶
func (r AdminGetLlamaextractFeaturesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminGetLlamaextractFeaturesResponse) UnmarshalJSON ¶
func (r *AdminGetLlamaextractFeaturesResponse) UnmarshalJSON(data []byte) error
type AdminGetLlamaextractFeaturesResponseAvailableMode ¶
type AdminGetLlamaextractFeaturesResponseAvailableMode struct {
Mode string `json:"mode" api:"required"`
ParseMode string `json:"parse_mode" api:"required"`
// Any of "available", "unavailable".
Status string `json:"status" api:"required"`
AvailableExtractModels []string `json:"available_extract_models"`
AvailableParseModels []string `json:"available_parse_models"`
MissingExtractModels []string `json:"missing_extract_models"`
MissingParseModels []string `json:"missing_parse_models"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Mode respjson.Field
ParseMode respjson.Field
Status respjson.Field
AvailableExtractModels respjson.Field
AvailableParseModels respjson.Field
MissingExtractModels respjson.Field
MissingParseModels respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AdminGetLlamaextractFeaturesResponseAvailableMode) RawJSON ¶
func (r AdminGetLlamaextractFeaturesResponseAvailableMode) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminGetLlamaextractFeaturesResponseAvailableMode) UnmarshalJSON ¶
func (r *AdminGetLlamaextractFeaturesResponseAvailableMode) UnmarshalJSON(data []byte) error
type AdminGetLlamaextractFeaturesResponseSchemaGeneration ¶
type AdminGetLlamaextractFeaturesResponseSchemaGeneration struct {
Model string `json:"model" api:"required"`
// Any of "available", "unavailable".
Status string `json:"status" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Model respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AdminGetLlamaextractFeaturesResponseSchemaGeneration) RawJSON ¶
func (r AdminGetLlamaextractFeaturesResponseSchemaGeneration) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminGetLlamaextractFeaturesResponseSchemaGeneration) UnmarshalJSON ¶
func (r *AdminGetLlamaextractFeaturesResponseSchemaGeneration) UnmarshalJSON(data []byte) error
type AdminGetLlmsInfoResponse ¶
type AdminGetLlmsInfoResponse struct {
LlmInfo map[string]map[string]AdminGetLlmsInfoResponseLlmInfo `json:"llm_info" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LlmInfo respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AdminGetLlmsInfoResponse) RawJSON ¶
func (r AdminGetLlmsInfoResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminGetLlmsInfoResponse) UnmarshalJSON ¶
func (r *AdminGetLlmsInfoResponse) UnmarshalJSON(data []byte) error
type AdminGetLlmsInfoResponseLlmInfo ¶
type AdminGetLlmsInfoResponseLlmInfo struct {
InternalModelName string `json:"internal_model_name" api:"required"`
Valid bool `json:"valid" api:"required"`
ErrorMessage string `json:"error_message" api:"nullable"`
LastValidated time.Time `json:"last_validated" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InternalModelName respjson.Field
Valid respjson.Field
ErrorMessage respjson.Field
LastValidated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AdminGetLlmsInfoResponseLlmInfo) RawJSON ¶
func (r AdminGetLlmsInfoResponseLlmInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminGetLlmsInfoResponseLlmInfo) UnmarshalJSON ¶
func (r *AdminGetLlmsInfoResponseLlmInfo) UnmarshalJSON(data []byte) error
type AdminGetOcrStatusResponse ¶
type AdminGetOcrStatusResponse struct {
// Any of "degraded", "ok", "unavailable".
Status AdminGetOcrStatusResponseStatus `json:"status" api:"required"`
Device string `json:"device"`
ErrorMessage string `json:"error_message" api:"nullable"`
GPUAvailable bool `json:"gpu_available"`
GPUDeviceCount int64 `json:"gpu_device_count" api:"nullable"`
GPUDeviceName string `json:"gpu_device_name" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
Device respjson.Field
ErrorMessage respjson.Field
GPUAvailable respjson.Field
GPUDeviceCount respjson.Field
GPUDeviceName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response model for OCR service health/GPU status.
func (AdminGetOcrStatusResponse) RawJSON ¶
func (r AdminGetOcrStatusResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminGetOcrStatusResponse) UnmarshalJSON ¶
func (r *AdminGetOcrStatusResponse) UnmarshalJSON(data []byte) error
type AdminGetOcrStatusResponseStatus ¶
type AdminGetOcrStatusResponseStatus string
const ( AdminGetOcrStatusResponseStatusDegraded AdminGetOcrStatusResponseStatus = "degraded" AdminGetOcrStatusResponseStatusOk AdminGetOcrStatusResponseStatus = "ok" )
type AdminService ¶
type AdminService struct {
Users AdminUserService
UsageMetrics AdminUsageMetricService
// contains filtered or unexported fields
}
AdminService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewAdminService method instead.
func NewAdminService ¶
func NewAdminService(opts ...option.RequestOption) (r AdminService)
NewAdminService 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 (*AdminService) GetFilestoresInfo ¶
func (r *AdminService) GetFilestoresInfo(ctx context.Context, opts ...option.RequestOption) (res *AdminGetFilestoresInfoResponse, err error)
Get File Store Info
func (*AdminService) GetLicenseInfo ¶
func (r *AdminService) GetLicenseInfo(ctx context.Context, query AdminGetLicenseInfoParams, opts ...option.RequestOption) (res *AdminGetLicenseInfoResponse, err error)
Get License Info
func (*AdminService) GetLlamaextractFeatures ¶
func (r *AdminService) GetLlamaextractFeatures(ctx context.Context, opts ...option.RequestOption) (res *AdminGetLlamaextractFeaturesResponse, err error)
Get LlamaExtract feature availability based on available models.
func (*AdminService) GetLlmsInfo ¶
func (r *AdminService) GetLlmsInfo(ctx context.Context, opts ...option.RequestOption) (res *AdminGetLlmsInfoResponse, err error)
Get Llm Info
func (*AdminService) GetOcrStatus ¶
func (r *AdminService) GetOcrStatus(ctx context.Context, opts ...option.RequestOption) (res *AdminGetOcrStatusResponse, err error)
Get OCR service health status including GPU availability.
type AdminUsageMetricAggregateParams ¶
type AdminUsageMetricAggregateParams struct {
// Inclusive lower bound on the day (YYYY-MM-DD, UTC)
DayOnOrAfter string `query:"day_on_or_after" api:"required" json:"-"`
// Inclusive upper bound on the day (YYYY-MM-DD, UTC)
DayOnOrBefore string `query:"day_on_or_before" api:"required" json:"-"`
// Dimensions to group by: day, organization_id, project_id, event_type, user_id
GroupBy []string `query:"group_by,omitzero" api:"required" json:"-"`
// Filter by organization ID
OrganizationID param.Opt[string] `query:"organization_id,omitzero" json:"-"`
// Filter by project ID
ProjectID param.Opt[string] `query:"project_id,omitzero" json:"-"`
// Filter by user ID
UserID param.Opt[string] `query:"user_id,omitzero" json:"-"`
// Filter by event types
//
// Any of "audio_seconds_parsed", "chart_parsing_agentic",
// "chart_parsing_efficient", "chart_parsing_plus", "chat_message_sent",
// "confidence_score_high", "directory_count_snapshot",
// "directory_file_count_snapshot", "directory_files_exported",
// "directory_files_ingested", "directory_pages_exported", "extraction_num_pages",
// "form_parsing_pages", "image_classified", "index_retrieve_query",
// "layout_aware_chart_extraction", "layout_aware_parsing", "layout_extracted",
// "pages_classified", "pages_embedded", "pages_indexed", "pages_parsed",
// "pages_split", "pages_verified", "precise_bbox_extraction", "set_total_indexes",
// "set_total_pages_indexed", "spreadsheet_regions_extracted", "stored_file_count",
// "stored_file_mb".
EventTypes []string `query:"event_types,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AdminUsageMetricAggregateParams) URLQuery ¶
func (r AdminUsageMetricAggregateParams) URLQuery() (v url.Values, err error)
URLQuery serializes AdminUsageMetricAggregateParams's query parameters as `url.Values`.
type AdminUsageMetricAggregateResponse ¶
type AdminUsageMetricAggregateResponse struct {
// The aggregation buckets, ordered by total credits descending
Buckets []AdminUsageMetricAggregateResponseBucket `json:"buckets" api:"required"`
// The dimensions the metrics were grouped by
//
// Any of "day", "event_type", "organization_id", "project_id", "user_id".
GroupBy []string `json:"group_by" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Buckets respjson.Field
GroupBy respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing usage metrics aggregated by one or more dimensions.
func (AdminUsageMetricAggregateResponse) RawJSON ¶
func (r AdminUsageMetricAggregateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminUsageMetricAggregateResponse) UnmarshalJSON ¶
func (r *AdminUsageMetricAggregateResponse) UnmarshalJSON(data []byte) error
type AdminUsageMetricAggregateResponseBucket ¶
type AdminUsageMetricAggregateResponseBucket struct {
// The dimension values that define this bucket
Dimensions map[string]string `json:"dimensions" api:"required"`
// Number of metric rows in this bucket
MetricCount int64 `json:"metric_count" api:"required"`
// Total credits consumed by metrics in this bucket
TotalCredits AdminUsageMetricAggregateResponseBucketTotalCreditsUnion `json:"total_credits" api:"required"`
// Total of the metric `value` field in this bucket
TotalValue int64 `json:"total_value" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dimensions respjson.Field
MetricCount respjson.Field
TotalCredits respjson.Field
TotalValue respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A single aggregation bucket grouped by the requested dimensions.
func (AdminUsageMetricAggregateResponseBucket) RawJSON ¶
func (r AdminUsageMetricAggregateResponseBucket) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminUsageMetricAggregateResponseBucket) UnmarshalJSON ¶
func (r *AdminUsageMetricAggregateResponseBucket) UnmarshalJSON(data []byte) error
type AdminUsageMetricAggregateResponseBucketTotalCreditsUnion ¶
type AdminUsageMetricAggregateResponseBucketTotalCreditsUnion struct {
// This field will be present if the value is a [float64] instead of an object.
OfFloat float64 `json:",inline"`
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
JSON struct {
OfFloat respjson.Field
OfString respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
AdminUsageMetricAggregateResponseBucketTotalCreditsUnion contains all possible properties and values from [float64], [string].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfFloat OfString]
func (AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) AsFloat ¶
func (u AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) AsFloat() (v float64)
func (AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) AsString ¶
func (u AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) AsString() (v string)
func (AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) RawJSON ¶
func (u AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) UnmarshalJSON ¶
func (r *AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) UnmarshalJSON(data []byte) error
type AdminUsageMetricService ¶
type AdminUsageMetricService struct {
// contains filtered or unexported fields
}
AdminUsageMetricService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewAdminUsageMetricService method instead.
func NewAdminUsageMetricService ¶
func NewAdminUsageMetricService(opts ...option.RequestOption) (r AdminUsageMetricService)
NewAdminUsageMetricService 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 (*AdminUsageMetricService) Aggregate ¶
func (r *AdminUsageMetricService) Aggregate(ctx context.Context, query AdminUsageMetricAggregateParams, opts ...option.RequestOption) (res *AdminUsageMetricAggregateResponse, err error)
Aggregate usage metrics by one or more dimensions, reporting total credits used. Global admin only.
A date range is required, which bounds the scan via the `day`-leading index. Supplying `organization_id` narrows it further via the `(organization_id, day)` index.
Supported `group_by` dimensions: `day`, `organization_id`, `project_id`, `event_type`, `user_id`. Buckets are ordered by total credits descending.
type AdminUserService ¶
type AdminUserService struct {
// contains filtered or unexported fields
}
AdminUserService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewAdminUserService method instead.
func NewAdminUserService ¶
func NewAdminUserService(opts ...option.RequestOption) (r AdminUserService)
NewAdminUserService 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 (*AdminUserService) GetClaims ¶
func (r *AdminUserService) GetClaims(ctx context.Context, userID string, opts ...option.RequestOption) (res *UserClaims, err error)
Get a user's resolved custom claims.
Claims that have not been explicitly set fall back to their system default. Returns 404 if the user does not exist.
Global admin only.
func (*AdminUserService) UpdateClaims ¶
func (r *AdminUserService) UpdateClaims(ctx context.Context, userID string, body AdminUserUpdateClaimsParams, opts ...option.RequestOption) (res *UserClaims, err error)
Additively update a user's custom claims.
Claims in `set_claims` are added or overwritten; claims named in `remove_claims` are reset to their system default. Claims not referenced by either field are left unchanged, so a single claim can be changed without resending the full set. Returns the user's resolved claims after the update.
Returns 404 if the user does not exist.
Global admin only.
type AdminUserUpdateClaimsParams ¶
type AdminUserUpdateClaimsParams struct {
// Names of claims to reset to their system default.
//
// Any of "allow_org_deletion", "allowed_org_creation", "api_datasource_access",
// "maximum_org_creation".
RemoveClaims []string `json:"remove_claims,omitzero"`
// A partial set of custom claims for additive updates.
//
// Every field is optional. Only the claims explicitly provided in a request are
// added or overwritten; claims left unset are not touched, so callers can change a
// single claim without resending the full claim set.
SetClaims AdminUserUpdateClaimsParamsSetClaims `json:"set_claims,omitzero"`
// contains filtered or unexported fields
}
func (AdminUserUpdateClaimsParams) MarshalJSON ¶
func (r AdminUserUpdateClaimsParams) MarshalJSON() (data []byte, err error)
func (*AdminUserUpdateClaimsParams) UnmarshalJSON ¶
func (r *AdminUserUpdateClaimsParams) UnmarshalJSON(data []byte) error
type AdminUserUpdateClaimsParamsSetClaims ¶
type AdminUserUpdateClaimsParamsSetClaims struct {
// Whether the user is allowed to delete organizations.
AllowOrgDeletion param.Opt[bool] `json:"allow_org_deletion,omitzero"`
// Whether the user is allowed to create organizations.
AllowedOrgCreation param.Opt[bool] `json:"allowed_org_creation,omitzero"`
// Whether the user is allowed to access API data sources.
APIDatasourceAccess param.Opt[bool] `json:"api_datasource_access,omitzero"`
// Cap on how many organizations this user may create. None means unlimited. Only
// enforced when allowed_org_creation is True.
MaximumOrgCreation param.Opt[int64] `json:"maximum_org_creation,omitzero"`
// contains filtered or unexported fields
}
A partial set of custom claims for additive updates.
Every field is optional. Only the claims explicitly provided in a request are added or overwritten; claims left unset are not touched, so callers can change a single claim without resending the full claim set.
func (AdminUserUpdateClaimsParamsSetClaims) MarshalJSON ¶
func (r AdminUserUpdateClaimsParamsSetClaims) MarshalJSON() (data []byte, err error)
func (*AdminUserUpdateClaimsParamsSetClaims) UnmarshalJSON ¶
func (r *AdminUserUpdateClaimsParamsSetClaims) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Organizations OrganizationService
Projects ProjectService
Invites InviteService
Admin AdminService
// contains filtered or unexported fields
}
Client creates a struct with services and top level methods that help with interacting with the llama-cloud-admin API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (LLAMA_CLOUD_API_KEY, LLAMA_CLOUD_ADMIN_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CustomClaims ¶
type CustomClaims struct {
// Whether the user is allowed to delete organizations.
AllowOrgDeletion bool `json:"allow_org_deletion"`
// Whether the user is allowed to create organizations.
AllowedOrgCreation bool `json:"allowed_org_creation"`
// Whether the user is allowed to access API data sources.
APIDatasourceAccess bool `json:"api_datasource_access"`
// Cap on how many organizations this user may create. None means unlimited. Only
// enforced when allowed_org_creation is True.
MaximumOrgCreation int64 `json:"maximum_org_creation" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AllowOrgDeletion respjson.Field
AllowedOrgCreation respjson.Field
APIDatasourceAccess respjson.Field
MaximumOrgCreation respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Custom claims that dictate various limits or allowed behaviors. Currently these claims reside at a per user level. Claims may expand to a per organization level or project in the future.
func (CustomClaims) RawJSON ¶
func (r CustomClaims) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomClaims) UnmarshalJSON ¶
func (r *CustomClaims) UnmarshalJSON(data []byte) error
type Invite ¶
type Invite struct {
// The invite's unique identifier.
ID string `json:"id" api:"required"`
// The organization the user is invited to.
OrganizationID string `json:"organization_id" api:"required"`
// The organization's display name.
OrganizationName string `json:"organization_name" api:"required"`
// The role being granted (e.g. admin, viewer).
Role string `json:"role" api:"required"`
// Creation datetime
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
// Update datetime
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
OrganizationID respjson.Field
OrganizationName respjson.Field
Role respjson.Field
CreatedAt respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A pending invitation visible to the invitee.
func (*Invite) UnmarshalJSON ¶
type InviteAcceptResponse ¶
type InviteAcceptResponse struct {
// The organization the user just joined.
OrganizationID string `json:"organization_id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
OrganizationID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response for accepting an invitation.
func (InviteAcceptResponse) RawJSON ¶
func (r InviteAcceptResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InviteAcceptResponse) UnmarshalJSON ¶
func (r *InviteAcceptResponse) UnmarshalJSON(data []byte) error
type InviteListMineParams ¶
type InviteListMineParams struct {
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (InviteListMineParams) URLQuery ¶
func (r InviteListMineParams) URLQuery() (v url.Values, err error)
URLQuery serializes InviteListMineParams's query parameters as `url.Values`.
type InviteService ¶
type InviteService struct {
// contains filtered or unexported fields
}
InviteService contains methods and other services that help with interacting with the llama-cloud-admin 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) Accept ¶
func (r *InviteService) Accept(ctx context.Context, inviteID string, opts ...option.RequestOption) (res *InviteAcceptResponse, err error)
Accept a pending invitation. Returns the joined organization id.
func (*InviteService) Decline ¶
func (r *InviteService) Decline(ctx context.Context, inviteID string, opts ...option.RequestOption) (err error)
Decline a pending invitation.
func (*InviteService) ListMine ¶
func (r *InviteService) ListMine(ctx context.Context, query InviteListMineParams, opts ...option.RequestOption) (res *pagination.PaginatedCursor[Invite], err error)
List the current user's pending invitations, cursor-paginated.
func (*InviteService) ListMineAutoPaging ¶
func (r *InviteService) ListMineAutoPaging(ctx context.Context, query InviteListMineParams, opts ...option.RequestOption) *pagination.PaginatedCursorAutoPager[Invite]
List the current user's pending invitations, cursor-paginated.
type Organization ¶
type Organization struct {
// The organization's unique identifier.
ID string `json:"id" api:"required"`
// The organization's display name.
Name string `json:"name" api:"required"`
// Creation datetime
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
// Additional organization metadata.
Metadata map[string]any `json:"metadata"`
// Update datetime
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
CreatedAt respjson.Field
Metadata respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
API response schema for an organization.
func (Organization) RawJSON ¶
func (r Organization) RawJSON() string
Returns the unmodified JSON received from the API
func (*Organization) UnmarshalJSON ¶
func (r *Organization) UnmarshalJSON(data []byte) error
type OrganizationGetUsageParams ¶
type OrganizationGetUsageParams struct {
GetCurrentInvoiceTotal param.Opt[bool] `query:"get_current_invoice_total,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (OrganizationGetUsageParams) URLQuery ¶
func (r OrganizationGetUsageParams) URLQuery() (v url.Values, err error)
URLQuery serializes OrganizationGetUsageParams's query parameters as `url.Values`.
type OrganizationListParams ¶
type OrganizationListParams struct {
Name param.Opt[string] `query:"name,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (OrganizationListParams) URLQuery ¶
func (r OrganizationListParams) URLQuery() (v url.Values, err error)
URLQuery serializes OrganizationListParams's query parameters as `url.Values`.
type OrganizationMember ¶
type OrganizationMember struct {
// Unique identifier
ID string `json:"id" api:"required" format:"uuid"`
// The organization's ID.
OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
// The roles of the user in the organization.
Roles []UserOrganizationRole `json:"roles" api:"required"`
// Creation datetime
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
// The user's email address.
Email string `json:"email" api:"nullable" format:"email"`
// The email address of the user who added the user to the organization.
//
// Deprecated: deprecated
InvitedByUserEmail string `json:"invited_by_user_email" api:"nullable" format:"email"`
// The user ID of the user who added the user to the organization.
InvitedByUserID string `json:"invited_by_user_id" api:"nullable"`
// Whether the user's membership is pending account signup.
Pending bool `json:"pending"`
// Update datetime
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// The user's ID.
UserID string `json:"user_id" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
OrganizationID respjson.Field
Roles respjson.Field
CreatedAt respjson.Field
Email respjson.Field
InvitedByUserEmail respjson.Field
InvitedByUserID respjson.Field
Pending respjson.Field
UpdatedAt respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A user's membership in an organization, including roles.
func (OrganizationMember) RawJSON ¶
func (r OrganizationMember) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrganizationMember) UnmarshalJSON ¶
func (r *OrganizationMember) UnmarshalJSON(data []byte) error
type OrganizationNewParams ¶
type OrganizationNewParams struct {
// The organization's display name.
Name string `json:"name" api:"required"`
// contains filtered or unexported fields
}
func (OrganizationNewParams) MarshalJSON ¶
func (r OrganizationNewParams) MarshalJSON() (data []byte, err error)
func (*OrganizationNewParams) UnmarshalJSON ¶
func (r *OrganizationNewParams) UnmarshalJSON(data []byte) error
type OrganizationRoleService ¶
type OrganizationRoleService struct {
// contains filtered or unexported fields
}
OrganizationRoleService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewOrganizationRoleService method instead.
func NewOrganizationRoleService ¶
func NewOrganizationRoleService(opts ...option.RequestOption) (r OrganizationRoleService)
NewOrganizationRoleService 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 (*OrganizationRoleService) List ¶
func (r *OrganizationRoleService) List(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *[]Role, err error)
List all roles in an organization.
type OrganizationService ¶
type OrganizationService struct {
Users OrganizationUserService
Roles OrganizationRoleService
// contains filtered or unexported fields
}
OrganizationService contains methods and other services that help with interacting with the llama-cloud-admin 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 ¶
func (r *OrganizationService) Delete(ctx context.Context, organizationID string, opts ...option.RequestOption) (err error)
Delete an organization by ID.
func (*OrganizationService) Get ¶
func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *Organization, err error)
Get an organization by ID.
func (*OrganizationService) GetUsage ¶
func (r *OrganizationService) GetUsage(ctx context.Context, organizationID string, query OrganizationGetUsageParams, opts ...option.RequestOption) (res *UsageAndPlan, err error)
Get usage for a specific organization.
func (*OrganizationService) List ¶
func (r *OrganizationService) List(ctx context.Context, query OrganizationListParams, opts ...option.RequestOption) (res *pagination.PaginatedCursor[Organization], err error)
List organizations the current user can access.
func (*OrganizationService) ListAutoPaging ¶
func (r *OrganizationService) ListAutoPaging(ctx context.Context, query OrganizationListParams, opts ...option.RequestOption) *pagination.PaginatedCursorAutoPager[Organization]
List organizations the current user can access.
func (*OrganizationService) New ¶
func (r *OrganizationService) New(ctx context.Context, body OrganizationNewParams, opts ...option.RequestOption) (res *Organization, err error)
Create a new organization.
func (*OrganizationService) Update ¶
func (r *OrganizationService) Update(ctx context.Context, organizationID string, body OrganizationUpdateParams, opts ...option.RequestOption) (res *Organization, err error)
Update an existing organization.
type OrganizationUpdateParams ¶
type OrganizationUpdateParams struct {
// The organization's new display name.
Name string `json:"name" api:"required"`
// contains filtered or unexported fields
}
func (OrganizationUpdateParams) MarshalJSON ¶
func (r OrganizationUpdateParams) MarshalJSON() (data []byte, err error)
func (*OrganizationUpdateParams) UnmarshalJSON ¶
func (r *OrganizationUpdateParams) UnmarshalJSON(data []byte) error
type OrganizationUserAddParams ¶
type OrganizationUserAddParams struct {
Body []OrganizationUserAddParamsBody
// contains filtered or unexported fields
}
func (OrganizationUserAddParams) MarshalJSON ¶
func (r OrganizationUserAddParams) MarshalJSON() (data []byte, err error)
func (*OrganizationUserAddParams) UnmarshalJSON ¶
func (r *OrganizationUserAddParams) UnmarshalJSON(data []byte) error
type OrganizationUserAddParamsBody ¶
type OrganizationUserAddParamsBody struct {
// The project IDs to add the user to.
ProjectIDs []string `json:"project_ids,omitzero" api:"required" format:"uuid"`
// The user's email address.
Email param.Opt[string] `json:"email,omitzero" format:"email"`
// The role ID to assign to the user.
RoleID param.Opt[string] `json:"role_id,omitzero" format:"uuid"`
// The user's ID.
UserID param.Opt[string] `json:"user_id,omitzero"`
// contains filtered or unexported fields
}
Request to add a user to an organization.
The property ProjectIDs is required.
func (OrganizationUserAddParamsBody) MarshalJSON ¶
func (r OrganizationUserAddParamsBody) MarshalJSON() (data []byte, err error)
func (*OrganizationUserAddParamsBody) UnmarshalJSON ¶
func (r *OrganizationUserAddParamsBody) UnmarshalJSON(data []byte) error
type OrganizationUserAddToProjectParams ¶
type OrganizationUserAddToProjectParams struct {
OrganizationID string `path:"organization_id" api:"required" format:"uuid" json:"-"`
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
func (OrganizationUserAddToProjectParams) URLQuery ¶
func (r OrganizationUserAddToProjectParams) URLQuery() (v url.Values, err error)
URLQuery serializes OrganizationUserAddToProjectParams's query parameters as `url.Values`.
type OrganizationUserAddToProjectResponse ¶
type OrganizationUserAddToProjectResponse = any
type OrganizationUserAssignRoleParams ¶
type OrganizationUserAssignRoleParams struct {
// The organization's ID.
OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
// The role's ID.
RoleID string `json:"role_id" api:"required" format:"uuid"`
// The user's ID.
UserID string `json:"user_id" api:"required"`
// contains filtered or unexported fields
}
func (OrganizationUserAssignRoleParams) MarshalJSON ¶
func (r OrganizationUserAssignRoleParams) MarshalJSON() (data []byte, err error)
func (*OrganizationUserAssignRoleParams) UnmarshalJSON ¶
func (r *OrganizationUserAssignRoleParams) UnmarshalJSON(data []byte) error
type OrganizationUserDeleteParams ¶
type OrganizationUserDeleteParams struct {
OrganizationID string `path:"organization_id" api:"required" format:"uuid" json:"-"`
Body []string
// contains filtered or unexported fields
}
func (OrganizationUserDeleteParams) MarshalJSON ¶
func (r OrganizationUserDeleteParams) MarshalJSON() (data []byte, err error)
func (*OrganizationUserDeleteParams) UnmarshalJSON ¶
func (r *OrganizationUserDeleteParams) UnmarshalJSON(data []byte) error
type OrganizationUserListProjectsParams ¶
type OrganizationUserListProjectsParams struct {
OrganizationID string `path:"organization_id" api:"required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type OrganizationUserListProjectsResponse ¶
type OrganizationUserListProjectsResponse struct {
// Unique identifier
ID string `json:"id" api:"required" format:"uuid"`
Name string `json:"name" api:"required"`
// The Organization ID the project is under.
OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
// Creation datetime
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
// Whether this project is the default project for the user.
IsDefault bool `json:"is_default"`
// Update datetime
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
OrganizationID respjson.Field
CreatedAt respjson.Field
IsDefault respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Schema for a project.
func (OrganizationUserListProjectsResponse) RawJSON ¶
func (r OrganizationUserListProjectsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrganizationUserListProjectsResponse) UnmarshalJSON ¶
func (r *OrganizationUserListProjectsResponse) UnmarshalJSON(data []byte) error
type OrganizationUserRemoveFromProjectResponse ¶
type OrganizationUserRemoveFromProjectResponse = any
type OrganizationUserService ¶
type OrganizationUserService struct {
// contains filtered or unexported fields
}
OrganizationUserService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewOrganizationUserService method instead.
func NewOrganizationUserService ¶
func NewOrganizationUserService(opts ...option.RequestOption) (r OrganizationUserService)
NewOrganizationUserService 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 (*OrganizationUserService) Add ¶
func (r *OrganizationUserService) Add(ctx context.Context, organizationID string, body OrganizationUserAddParams, opts ...option.RequestOption) (res *[]OrganizationMember, err error)
Add a user to an organization.
func (*OrganizationUserService) AddToProject ¶
func (r *OrganizationUserService) AddToProject(ctx context.Context, userID string, params OrganizationUserAddToProjectParams, opts ...option.RequestOption) (res *OrganizationUserAddToProjectResponse, err error)
Add a user to a project.
func (*OrganizationUserService) AssignRole ¶
func (r *OrganizationUserService) AssignRole(ctx context.Context, organizationID string, body OrganizationUserAssignRoleParams, opts ...option.RequestOption) (res *UserOrganizationRole, err error)
Assign a role to a user in an organization.
func (*OrganizationUserService) Delete ¶
func (r *OrganizationUserService) Delete(ctx context.Context, memberUserID string, params OrganizationUserDeleteParams, opts ...option.RequestOption) (err error)
Remove users from an organization.
func (*OrganizationUserService) ListMembers ¶
func (r *OrganizationUserService) ListMembers(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *[]OrganizationMember, err error)
Get all users in an organization.
func (*OrganizationUserService) ListProjects ¶
func (r *OrganizationUserService) ListProjects(ctx context.Context, userID string, query OrganizationUserListProjectsParams, opts ...option.RequestOption) (res *[]OrganizationUserListProjectsResponse, err error)
List all projects for a user in an organization.
func (*OrganizationUserService) RemoveFromProject ¶
func (r *OrganizationUserService) RemoveFromProject(ctx context.Context, projectID string, body OrganizationUserRemoveFromProjectParams, opts ...option.RequestOption) (res *OrganizationUserRemoveFromProjectResponse, err error)
Remove a user from a project.
type Project ¶
type Project struct {
// The project's unique identifier.
ID string `json:"id" api:"required"`
// The project's display name.
Name string `json:"name" api:"required"`
// The organization the project belongs to.
OrganizationID string `json:"organization_id" api:"required"`
// Creation datetime
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
// Whether this project is the default project for its organization.
IsDefault bool `json:"is_default"`
// Update datetime
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
OrganizationID respjson.Field
CreatedAt respjson.Field
IsDefault respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
API response schema for a project.
func (*Project) UnmarshalJSON ¶
type ProjectDeleteParams ¶
type ProjectDeleteParams struct {
OrganizationID param.Opt[string] `query:"organization_id,omitzero" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
func (ProjectDeleteParams) URLQuery ¶
func (r ProjectDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectDeleteParams's query parameters as `url.Values`.
type ProjectGetParams ¶
type ProjectGetParams struct {
OrganizationID param.Opt[string] `query:"organization_id,omitzero" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
func (ProjectGetParams) URLQuery ¶
func (r ProjectGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectGetParams's query parameters as `url.Values`.
type ProjectListParams ¶
type ProjectListParams struct {
Name param.Opt[string] `query:"name,omitzero" json:"-"`
OrganizationID param.Opt[string] `query:"organization_id,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ProjectListParams) URLQuery ¶
func (r ProjectListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectListParams's query parameters as `url.Values`.
type ProjectNewParams ¶
type ProjectNewParams struct {
OrganizationID string `query:"organization_id" api:"required" format:"uuid" json:"-"`
// The project's display name.
Name string `json:"name" api:"required"`
// contains filtered or unexported fields
}
func (ProjectNewParams) MarshalJSON ¶
func (r ProjectNewParams) MarshalJSON() (data []byte, err error)
func (ProjectNewParams) URLQuery ¶
func (r ProjectNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectNewParams's query parameters as `url.Values`.
func (*ProjectNewParams) UnmarshalJSON ¶
func (r *ProjectNewParams) UnmarshalJSON(data []byte) error
type ProjectService ¶
type ProjectService struct {
// contains filtered or unexported fields
}
ProjectService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewProjectService method instead.
func NewProjectService ¶
func NewProjectService(opts ...option.RequestOption) (r ProjectService)
NewProjectService 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 (*ProjectService) Delete ¶
func (r *ProjectService) Delete(ctx context.Context, projectID string, body ProjectDeleteParams, opts ...option.RequestOption) (err error)
Delete a project by ID.
func (*ProjectService) Get ¶
func (r *ProjectService) Get(ctx context.Context, projectID string, query ProjectGetParams, opts ...option.RequestOption) (res *Project, err error)
Get a project by ID.
func (*ProjectService) List ¶
func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *pagination.PaginatedCursor[Project], err error)
List projects in an organization. Requires `organization_id` or a project-scoped API key.
func (*ProjectService) ListAutoPaging ¶
func (r *ProjectService) ListAutoPaging(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) *pagination.PaginatedCursorAutoPager[Project]
List projects in an organization. Requires `organization_id` or a project-scoped API key.
func (*ProjectService) New ¶
func (r *ProjectService) New(ctx context.Context, params ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)
Create a new project in the given organization.
func (*ProjectService) Update ¶
func (r *ProjectService) Update(ctx context.Context, projectID string, params ProjectUpdateParams, opts ...option.RequestOption) (res *Project, err error)
Update an existing project.
type ProjectUpdateParams ¶
type ProjectUpdateParams struct {
// The project's new display name.
Name string `json:"name" api:"required"`
OrganizationID param.Opt[string] `query:"organization_id,omitzero" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
func (ProjectUpdateParams) MarshalJSON ¶
func (r ProjectUpdateParams) MarshalJSON() (data []byte, err error)
func (ProjectUpdateParams) URLQuery ¶
func (r ProjectUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectUpdateParams's query parameters as `url.Values`.
func (*ProjectUpdateParams) UnmarshalJSON ¶
func (r *ProjectUpdateParams) UnmarshalJSON(data []byte) error
type Role ¶
type Role struct {
// Unique identifier
ID string `json:"id" api:"required" format:"uuid"`
// A name for the role.
Name string `json:"name" api:"required"`
// The actual permissions of the role.
Permissions []RolePermission `json:"permissions" api:"required"`
// Creation datetime
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
// Update datetime
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
Permissions respjson.Field
CreatedAt respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Schema for a role.
func (*Role) UnmarshalJSON ¶
type RolePermission ¶
type RolePermission struct {
// Unique identifier
ID string `json:"id" api:"required" format:"uuid"`
// Whether the permission is granted or not.
Access bool `json:"access" api:"required"`
// A description for the permission.
Description string `json:"description" api:"required"`
// A name for the permission.
Name string `json:"name" api:"required"`
// Creation datetime
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
// Update datetime
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Access respjson.Field
Description respjson.Field
Name respjson.Field
CreatedAt respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Schema for a permission.
func (RolePermission) RawJSON ¶
func (r RolePermission) RawJSON() string
Returns the unmodified JSON received from the API
func (*RolePermission) UnmarshalJSON ¶
func (r *RolePermission) UnmarshalJSON(data []byte) error
type UsageAndPlan ¶
type UsageAndPlan struct {
Plan UsageAndPlanPlan `json:"plan" api:"required"`
// Account usage totals shown alongside the plan.
Usage UsageAndPlanUsage `json:"usage" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Plan respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UsageAndPlan) RawJSON ¶
func (r UsageAndPlan) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageAndPlan) UnmarshalJSON ¶
func (r *UsageAndPlan) UnmarshalJSON(data []byte) error
type UsageAndPlanPlan ¶
type UsageAndPlanPlan struct {
Limits UsageAndPlanPlanLimits `json:"limits" api:"required"`
// Any of "enterprise", "enterprise_contract", "enterprise_poc", "free",
// "free_contract", "free_v1", "free_v2", "llama_parse", "pro", "pro_v1", "pro_v2",
// "starter_v1", "starter_v2", "unknown", "yc_deal_v1".
Name string `json:"name" api:"required"`
// Any of "ANNUAL", "MONTHLY", "QUARTERLY".
PlanFrequency string `json:"plan_frequency" api:"required"`
// The ID of the plan in Metronome
ID string `json:"id" api:"nullable"`
// The current billing period
CurrentBillingPeriod UsageAndPlanPlanCurrentBillingPeriod `json:"current_billing_period" api:"nullable"`
// The date the plan ends on
EndingBefore time.Time `json:"ending_before" api:"nullable" format:"date-time"`
// The number of payment failures for this organization
FailureCount int64 `json:"failure_count"`
// Whether the organization has a failed payment that requires support contact
IsPaymentFailed bool `json:"is_payment_failed"`
RecurringCredits []UsageAndPlanPlanRecurringCredit `json:"recurring_credits" api:"nullable"`
// The date the plan starts on
StartingOn time.Time `json:"starting_on" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Limits respjson.Field
Name respjson.Field
PlanFrequency respjson.Field
ID respjson.Field
CurrentBillingPeriod respjson.Field
EndingBefore respjson.Field
FailureCount respjson.Field
IsPaymentFailed respjson.Field
RecurringCredits respjson.Field
StartingOn respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UsageAndPlanPlan) RawJSON ¶
func (r UsageAndPlanPlan) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageAndPlanPlan) UnmarshalJSON ¶
func (r *UsageAndPlanPlan) UnmarshalJSON(data []byte) error
type UsageAndPlanPlanCurrentBillingPeriod ¶
type UsageAndPlanPlanCurrentBillingPeriod struct {
EndDate time.Time `json:"end_date" api:"required" format:"date-time"`
StartDate time.Time `json:"start_date" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndDate respjson.Field
StartDate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The current billing period
func (UsageAndPlanPlanCurrentBillingPeriod) RawJSON ¶
func (r UsageAndPlanPlanCurrentBillingPeriod) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageAndPlanPlanCurrentBillingPeriod) UnmarshalJSON ¶
func (r *UsageAndPlanPlanCurrentBillingPeriod) UnmarshalJSON(data []byte) error
type UsageAndPlanPlanLimits ¶
type UsageAndPlanPlanLimits struct {
// Whether usage is allowed after credit grants are exhausted
AllowPayAsYouGo bool `json:"allow_pay_as_you_go" api:"required"`
MaxConcurrentIndexJobs int64 `json:"max_concurrent_index_jobs" api:"required"`
MaxConcurrentParseJobsOther int64 `json:"max_concurrent_parse_jobs_other" api:"required"`
MaxConcurrentParseJobsPremium int64 `json:"max_concurrent_parse_jobs_premium" api:"required"`
MaxDataSinks int64 `json:"max_data_sinks" api:"required"`
MaxDataSources int64 `json:"max_data_sources" api:"required"`
MaxEmbeddingModels int64 `json:"max_embedding_models" api:"required"`
MaxExtractionAgents int64 `json:"max_extraction_agents" api:"required"`
MaxExtractionJobs int64 `json:"max_extraction_jobs" api:"required"`
MaxExtractionRuns int64 `json:"max_extraction_runs" api:"required"`
MaxFilesPerIndex int64 `json:"max_files_per_index" api:"required"`
MaxIndexes int64 `json:"max_indexes" api:"required"`
MaxMonthlyInvoiceTotalUsd int64 `json:"max_monthly_invoice_total_usd" api:"required"`
MaxOrganizations int64 `json:"max_organizations" api:"required"`
MaxPagesPerIndex int64 `json:"max_pages_per_index" api:"required"`
MaxProjects int64 `json:"max_projects" api:"required"`
MaxPublishedAgents int64 `json:"max_published_agents" api:"required"`
MaxReportAgentSessions int64 `json:"max_report_agent_sessions" api:"required"`
MaxUsers int64 `json:"max_users" api:"required"`
MfaEnabled bool `json:"mfa_enabled" api:"required"`
SSOEnabled bool `json:"sso_enabled" api:"required"`
SubscriptionCostUsd int64 `json:"subscription_cost_usd" api:"required"`
MaxDirectories int64 `json:"max_directories" api:"nullable"`
MaxDirectoryFilesPerDirectory int64 `json:"max_directory_files_per_directory" api:"nullable"`
MaxDirectoryIngestFiles int64 `json:"max_directory_ingest_files" api:"nullable"`
MaxDirectorySyncPlanActions int64 `json:"max_directory_sync_plan_actions" api:"nullable"`
// The amount of USD cents at which a soft alert should be triggered
SpendingSoftAlertsUsdCents []int64 `json:"spending_soft_alerts_usd_cents" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AllowPayAsYouGo respjson.Field
MaxConcurrentIndexJobs respjson.Field
MaxConcurrentParseJobsOther respjson.Field
MaxConcurrentParseJobsPremium respjson.Field
MaxDataSinks respjson.Field
MaxDataSources respjson.Field
MaxEmbeddingModels respjson.Field
MaxExtractionAgents respjson.Field
MaxExtractionJobs respjson.Field
MaxExtractionRuns respjson.Field
MaxFilesPerIndex respjson.Field
MaxIndexes respjson.Field
MaxMonthlyInvoiceTotalUsd respjson.Field
MaxOrganizations respjson.Field
MaxPagesPerIndex respjson.Field
MaxProjects respjson.Field
MaxPublishedAgents respjson.Field
MaxReportAgentSessions respjson.Field
MaxUsers respjson.Field
MfaEnabled respjson.Field
SSOEnabled respjson.Field
SubscriptionCostUsd respjson.Field
MaxDirectories respjson.Field
MaxDirectoryFilesPerDirectory respjson.Field
MaxDirectoryIngestFiles respjson.Field
MaxDirectorySyncPlanActions respjson.Field
SpendingSoftAlertsUsdCents respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UsageAndPlanPlanLimits) RawJSON ¶
func (r UsageAndPlanPlanLimits) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageAndPlanPlanLimits) UnmarshalJSON ¶
func (r *UsageAndPlanPlanLimits) UnmarshalJSON(data []byte) error
type UsageAndPlanPlanRecurringCredit ¶
type UsageAndPlanPlanRecurringCredit struct {
CreditAmount int64 `json:"credit_amount" api:"required"`
CreditType UsageAndPlanPlanRecurringCreditCreditType `json:"credit_type" api:"required"`
Name string `json:"name" api:"required"`
Priority float64 `json:"priority" api:"required"`
// The ID of the product in Metronome used to represent the credit grant
ProductID string `json:"product_id" api:"required"`
// The fraction of the credit that will roll over to the next period, between 0 and
// 1
RolloverFraction float64 `json:"rollover_fraction" api:"required"`
// How many billing periods the credit grant will last for
PeriodsDuration float64 `json:"periods_duration"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreditAmount respjson.Field
CreditType respjson.Field
Name respjson.Field
Priority respjson.Field
ProductID respjson.Field
RolloverFraction respjson.Field
PeriodsDuration respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UsageAndPlanPlanRecurringCredit) RawJSON ¶
func (r UsageAndPlanPlanRecurringCredit) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageAndPlanPlanRecurringCredit) UnmarshalJSON ¶
func (r *UsageAndPlanPlanRecurringCredit) UnmarshalJSON(data []byte) error
type UsageAndPlanPlanRecurringCreditCreditType ¶
type UsageAndPlanPlanRecurringCreditCreditType struct {
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UsageAndPlanPlanRecurringCreditCreditType) RawJSON ¶
func (r UsageAndPlanPlanRecurringCreditCreditType) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageAndPlanPlanRecurringCreditCreditType) UnmarshalJSON ¶
func (r *UsageAndPlanPlanRecurringCreditCreditType) UnmarshalJSON(data []byte) error
type UsageAndPlanUsage ¶
type UsageAndPlanUsage struct {
// Any of "configured_spend_limit_exceeded", "free_credits_exhausted",
// "has_spending_alert", "internal_spending_alert", "plan_spend_limit_exceeded",
// "plan_spend_limit_soft_alert".
ActiveAlerts []string `json:"active_alerts"`
ActiveFreeCreditsUsage []UsageAndPlanUsageActiveFreeCreditsUsage `json:"active_free_credits_usage"`
CurrentInvoiceTotalUsdCents int64 `json:"current_invoice_total_usd_cents" api:"nullable"`
TotalExtractionAgents int64 `json:"total_extraction_agents"`
TotalIndexedPages int64 `json:"total_indexed_pages"`
TotalIndexes int64 `json:"total_indexes"`
TotalUsers int64 `json:"total_users"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ActiveAlerts respjson.Field
ActiveFreeCreditsUsage respjson.Field
CurrentInvoiceTotalUsdCents respjson.Field
TotalExtractionAgents respjson.Field
TotalIndexedPages respjson.Field
TotalIndexes respjson.Field
TotalUsers respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Account usage totals shown alongside the plan.
func (UsageAndPlanUsage) RawJSON ¶
func (r UsageAndPlanUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageAndPlanUsage) UnmarshalJSON ¶
func (r *UsageAndPlanUsage) UnmarshalJSON(data []byte) error
type UsageAndPlanUsageActiveFreeCreditsUsage ¶
type UsageAndPlanUsageActiveFreeCreditsUsage struct {
ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
GrantName string `json:"grant_name" api:"required"`
RemainingBalance int64 `json:"remaining_balance" api:"required"`
StartingBalance int64 `json:"starting_balance" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExpiresAt respjson.Field
GrantName respjson.Field
RemainingBalance respjson.Field
StartingBalance respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UsageAndPlanUsageActiveFreeCreditsUsage) RawJSON ¶
func (r UsageAndPlanUsageActiveFreeCreditsUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageAndPlanUsageActiveFreeCreditsUsage) UnmarshalJSON ¶
func (r *UsageAndPlanUsageActiveFreeCreditsUsage) UnmarshalJSON(data []byte) error
type UserClaims ¶
type UserClaims struct {
// The user's resolved custom claims.
Claims CustomClaims `json:"claims" api:"required"`
// The user ID the claims belong to.
UserID string `json:"user_id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Claims respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A user's fully resolved custom claims after applying system defaults.
func (UserClaims) RawJSON ¶
func (r UserClaims) RawJSON() string
Returns the unmodified JSON received from the API
func (*UserClaims) UnmarshalJSON ¶
func (r *UserClaims) UnmarshalJSON(data []byte) error
type UserOrganizationRole ¶
type UserOrganizationRole struct {
// Unique identifier
ID string `json:"id" api:"required" format:"uuid"`
// The organization's ID.
OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
// The role.
Role Role `json:"role" api:"required"`
// The user's ID.
UserID string `json:"user_id" api:"required"`
// Creation datetime
CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
// The project ID scope.
ProjectIDs []string `json:"project_ids" api:"nullable" format:"uuid"`
// Update datetime
UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
OrganizationID respjson.Field
Role respjson.Field
UserID respjson.Field
CreatedAt respjson.Field
ProjectIDs respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Schema for a user's role in an organization.
func (UserOrganizationRole) RawJSON ¶
func (r UserOrganizationRole) RawJSON() string
Returns the unmodified JSON received from the API
func (*UserOrganizationRole) UnmarshalJSON ¶
func (r *UserOrganizationRole) UnmarshalJSON(data []byte) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|