#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct CreateTokenDTO {
#[serde(rename = "expiresAt")]
pub expires_at: chrono::DateTime<chrono::Utc>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct WorkerCreationRequest {
pub name: String,
pub args: Vec<String>,
pub env: Vec<(String, String)>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct VersionedTemplateId {
#[serde(rename = "rawTemplateId")]
pub raw_template_id: uuid::Uuid,
pub version: i32,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct UserTemplateId {
#[serde(rename = "versionedComponentId")]
pub versioned_component_id: crate::model::VersionedTemplateId,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ProtectedTemplateId {
#[serde(rename = "versionedComponentId")]
pub versioned_component_id: crate::model::VersionedTemplateId,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct TemplateName {
pub value: String,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum Type {
Variant(Vec<(String, Option<Box<crate::model::Type>>)>),
Result((Option<Box<crate::model::Type>>, Option<Box<crate::model::Type>>)),
Option(Box<crate::model::Type>),
Enum(Vec<String>),
Flags(Vec<String>),
Record(Vec<(String, Box<crate::model::Type>)>),
Tuple(Vec<Box<crate::model::Type>>),
List(Box<crate::model::Type>),
Str {
},
Chr {
},
F64 {
},
F32 {
},
U64 {
},
S64 {
},
U32 {
},
S32 {
},
U16 {
},
S16 {
},
U8 {
},
S8 {
},
Bool {
},
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct FunctionParameter {
pub name: String,
pub tpe: crate::model::Type,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct FunctionResult {
pub name: Option<String>,
pub tpe: crate::model::Type,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct Function {
pub name: String,
pub parameters: Vec<crate::model::FunctionParameter>,
pub results: Vec<crate::model::FunctionResult>,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum Export {
Instance {
name: String,
functions: Vec<crate::model::Function>,
},
Function {
name: String,
parameters: Vec<crate::model::FunctionParameter>,
results: Vec<crate::model::FunctionResult>,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct VersionedName {
pub name: String,
pub version: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ProducerField {
pub name: String,
pub values: Vec<crate::model::VersionedName>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct Producers {
pub fields: Vec<crate::model::ProducerField>,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct TemplateMetadata {
pub exports: Vec<crate::model::Export>,
pub producers: Vec<crate::model::Producers>,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct Template {
#[serde(rename = "versionedTemplateId")]
pub versioned_template_id: crate::model::VersionedTemplateId,
#[serde(rename = "userTemplateId")]
pub user_template_id: crate::model::UserTemplateId,
#[serde(rename = "protectedTemplateId")]
pub protected_template_id: crate::model::ProtectedTemplateId,
#[serde(rename = "templateName")]
pub template_name: crate::model::TemplateName,
#[serde(rename = "templateSize")]
pub template_size: i32,
pub metadata: crate::model::TemplateMetadata,
#[serde(rename = "projectId")]
pub project_id: uuid::Uuid,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct CompleteParameters {
#[serde(rename = "oplogIdx")]
pub oplog_idx: i32,
pub data: Vec<u8>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum ProjectType {
Default,
NonDefault,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ProjectData {
pub name: String,
#[serde(rename = "ownerAccountId")]
pub owner_account_id: String,
pub description: String,
#[serde(rename = "defaultEnvironmentId")]
pub default_environment_id: String,
#[serde(rename = "projectType")]
pub project_type: crate::model::ProjectType,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct Project {
#[serde(rename = "projectId")]
pub project_id: uuid::Uuid,
#[serde(rename = "projectData")]
pub project_data: crate::model::ProjectData,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct InvocationKey {
pub value: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct Token {
pub id: uuid::Uuid,
#[serde(rename = "accountId")]
pub account_id: String,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "expiresAt")]
pub expires_at: chrono::DateTime<chrono::Utc>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ProjectGrantDataRequest {
#[serde(rename = "granteeAccountId")]
pub grantee_account_id: String,
#[serde(rename = "projectPolicyId")]
pub project_policy_id: uuid::Uuid,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum Role {
Admin,
WhitelistAdmin,
MarketingAdmin,
ViewProject,
DeleteProject,
CreateProject,
InstanceServer,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ResourceLimits {
#[serde(rename = "availableFuel")]
pub available_fuel: i64,
#[serde(rename = "maxMemoryPerInstance")]
pub max_memory_per_instance: i64,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum LoginEndpointError {
ArgValidation {
errors: Vec<String>,
},
NotWhitelisted {
error: String,
},
Internal {
error: String,
},
External {
error: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct Account {
pub id: String,
pub name: String,
pub email: String,
#[serde(rename = "planId")]
pub plan_id: uuid::Uuid,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum ProjectEndpointError {
ArgValidation {
errors: Vec<String>,
},
Internal {
error: String,
},
NotFound {
message: String,
},
Unauthorized {
message: String,
},
LimitExceeded {
error: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum AccountSummaryEndpointError {
Internal {
error: String,
},
Unauthorized {
message: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum AccountEndpointError {
ArgValidation {
errors: Vec<String>,
},
Internal {
error: String,
},
NotFound {
message: String,
},
Unauthorized {
message: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct VersionInfo {
pub version: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ProjectGrantData {
#[serde(rename = "granteeAccountId")]
pub grantee_account_id: String,
#[serde(rename = "grantorProjectId")]
pub grantor_project_id: uuid::Uuid,
#[serde(rename = "projectPolicyId")]
pub project_policy_id: uuid::Uuid,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ProjectGrant {
pub id: uuid::Uuid,
pub data: crate::model::ProjectGrantData,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct TokenSecret {
pub value: uuid::Uuid,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct UnsafeToken {
pub data: crate::model::Token,
pub secret: crate::model::TokenSecret,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct WorkerId {
#[serde(rename = "rawTemplateId")]
pub raw_template_id: uuid::Uuid,
#[serde(rename = "workerName")]
pub worker_name: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum WorkerStatus {
Running,
Idle,
Suspended,
Interrupted,
Retrying,
Failed,
Exited,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct WorkerMetadata {
#[serde(rename = "workerId")]
pub worker_id: crate::model::WorkerId,
#[serde(rename = "accountId")]
pub account_id: String,
pub args: Vec<String>,
pub env: std::collections::HashMap<String, String>,
pub status: crate::model::WorkerStatus,
#[serde(rename = "templateVersion")]
pub template_version: i32,
#[serde(rename = "retryCount")]
pub retry_count: i32,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum LimitsEndpointError {
ArgValidationError {
errors: Vec<String>,
},
InternalError {
error: String,
},
Unauthorized {
error: String,
},
LimitExceeded {
error: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct AccountSummary {
pub id: String,
pub name: String,
pub email: String,
#[serde(rename = "templatesCount")]
pub templates_count: i64,
#[serde(rename = "workersCount")]
pub workers_count: i64,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct TemplateQuery {
#[serde(rename = "projectId")]
pub project_id: Option<uuid::Uuid>,
#[serde(rename = "componentName")]
pub component_name: crate::model::TemplateName,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ProjectDataRequest {
pub name: String,
#[serde(rename = "ownerAccountId")]
pub owner_account_id: String,
pub description: String,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct InvokeResult {
pub result: serde_json::value::Value,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum TemplateEndpointError {
ArgValidationError {
errors: Vec<String>,
},
InternalError {
error: String,
},
NotFound {
message: String,
},
Unauthorized {
error: String,
},
LimitExceeded {
error: String,
},
AlreadyExists {
#[serde(rename = "componentId")]
component_id: uuid::Uuid,
},
GatewayTimeout {
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct PlanData {
#[serde(rename = "projectLimit")]
pub project_limit: i32,
#[serde(rename = "componentLimit")]
pub component_limit: i32,
#[serde(rename = "instanceLimit")]
pub instance_limit: i32,
#[serde(rename = "storageLimit")]
pub storage_limit: i32,
#[serde(rename = "monthlyGasLimit")]
pub monthly_gas_limit: i64,
#[serde(rename = "monthlyUploadLimit")]
pub monthly_upload_limit: i32,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct Plan {
#[serde(rename = "planId")]
pub plan_id: uuid::Uuid,
#[serde(rename = "planData")]
pub plan_data: crate::model::PlanData,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum ProjectAction {
ViewComponent,
CreateComponent,
UpdateComponent,
DeleteComponent,
ViewInstance,
CreateInstance,
UpdateInstance,
DeleteInstance,
ViewProjectGrants,
CreateProjectGrants,
DeleteProjectGrants,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct ProjectActions {
pub actions: std::collections::HashSet<crate::model::ProjectAction>,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct ProjectPolicy {
pub id: uuid::Uuid,
pub name: String,
#[serde(rename = "projectActions")]
pub project_actions: crate::model::ProjectActions,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct AccountData {
pub name: String,
pub email: String,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct BatchUpdateResourceLimits {
pub updates: std::collections::HashMap<String, i64>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct WhitelistEmail {
pub email: String,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "createdBy")]
pub created_by: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub enum WhitelistEndpointError {
Internal {
error: String,
},
Unauthorized {
message: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct VersionedWorkerId {
#[serde(rename = "workerId")]
pub worker_id: crate::model::WorkerId,
#[serde(rename = "templateVersionUsed")]
pub template_version_used: i32,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct PromiseId {
#[serde(rename = "instanceId")]
pub instance_id: crate::model::WorkerId,
#[serde(rename = "oplogIdx")]
pub oplog_idx: i32,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct ShardId {
pub value: i64,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum GolemError {
InvalidRequest {
details: String,
},
WorkerAlreadyExists {
#[serde(rename = "instanceId")]
instance_id: crate::model::WorkerId,
},
WorkerNotFound {
#[serde(rename = "instanceId")]
instance_id: crate::model::WorkerId,
},
WorkerCreationFailed {
#[serde(rename = "instanceId")]
instance_id: crate::model::WorkerId,
details: String,
},
FailedToResumeWorker {
#[serde(rename = "instanceId")]
instance_id: crate::model::WorkerId,
},
TemplateDownloadFailed {
#[serde(rename = "componentId")]
component_id: crate::model::VersionedTemplateId,
reason: String,
},
TemplateParseFailed {
#[serde(rename = "componentId")]
component_id: crate::model::VersionedTemplateId,
reason: String,
},
GetLatestVersionOfTemplateFailed {
#[serde(rename = "componentId")]
component_id: uuid::Uuid,
reason: String,
},
PromiseNotFound {
#[serde(rename = "promiseId")]
promise_id: crate::model::PromiseId,
},
PromiseDropped {
#[serde(rename = "promiseId")]
promise_id: crate::model::PromiseId,
},
PromiseAlreadyCompleted {
#[serde(rename = "promiseId")]
promise_id: crate::model::PromiseId,
},
Interrupted {
#[serde(rename = "recoverImmediately")]
recover_immediately: bool,
},
ParamTypeMismatch {
},
NoValueInMessage {
},
ValueMismatch {
details: String,
},
UnexpectedOplogEntry {
expected: String,
got: String,
},
RuntimeError {
details: String,
},
InvalidShardId {
#[serde(rename = "shardId")]
shard_id: crate::model::ShardId,
#[serde(rename = "shardIds")]
shard_ids: std::collections::HashSet<crate::model::ShardId>,
},
PreviousInvocationFailed {
},
PreviousInvocationExited {
},
Unknown {
details: String,
},
InstanceUnavailable {
},
InvalidAccount {
},
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum WorkerEndpointError {
BadRequest {
errors: Vec<String>,
},
Unauthorized {
error: String,
},
LimitExceeded {
error: String,
},
Golem {
#[serde(rename = "golemError")]
golem_error: crate::model::GolemError,
},
GatewayTimeout {
},
NotFound {
error: String,
},
AlreadyExists {
error: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
pub struct OAuth2Data {
pub url: String,
#[serde(rename = "userCode")]
pub user_code: String,
pub expires: chrono::DateTime<chrono::Utc>,
#[serde(rename = "encodedSession")]
pub encoded_session: String,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct ProjectPolicyData {
pub name: String,
#[serde(rename = "projectActions")]
pub project_actions: crate::model::ProjectActions,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct InvokeParameters {
pub params: serde_json::value::Value,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct ProjectGrantDataWithProjectActions {
#[serde(rename = "granteeAccountId")]
pub grantee_account_id: String,
#[serde(rename = "projectActions")]
pub project_actions: std::collections::HashSet<crate::model::ProjectAction>,
#[serde(rename = "projectPolicyName")]
pub project_policy_name: Option<String>,
}