import { ShapeDiverNullObject } from '../SdNullObject'; import { ShapeDiverCommonsGroup } from '../commons/SdCommonsGroup'; /** * @swagger {components.schemas} RequestModelFiletype { "description": "Supported file types for models.", "type": "string", "enum": [ "gh", "ghx" ] } */ /** Supported file types for models. */ export enum ShapeDiverRequestModelFiletype { GRASSHOPPER_BINARY = 'gh', GRASSHOPPER_XML = 'ghx', } /** * @swagger {components.schemas} RequestModelTrustlevel { "description": "Level of trust granted for a model.", "type": "string", "enum": [ "''", "none", "full" ] } */ /** Level of trust granted for a model. */ export enum ShapeDiverRequestModelTrustlevel { UNDEFINED = '', NONE = 'none', FULL = 'full', } /** * @swagger {components.schemas} RequestModel { "description": "Body of a template request.", "type": "object" } */ /** Body of a template request. */ export interface ShapeDiverRequestModel { /** * @swagger {components.schemas.RequestModel.properties} accessdomains { "description": "List of domains (origins) this model is limited to (is ignored in case pub is true).", "type": "array", "items": { "type": "string" } } */ /** List of domains (origins) this model is limited to (is ignored in case {@link pub} is true). */ accessdomains?: string[]; /** * @swagger {components.schemas.RequestModel.properties} allowed_libraries { "description": "List of allowed Grasshopper libraries.", "type": "array", "items": { "type": "string" } } */ /** List of allowed Grasshopper libraries. */ allowed_libraries?: string[]; /** * @swagger {components.schemas.RequestModel.properties} auth_groups { "description": "List of allowed auth-groups.", "type": "array", "items": { "type": "string" } } */ /** List of allowed auth-groups. */ auth_groups?: string[]; /** * @swagger {components.schemas.RequestModel.properties} backendaccess { "description": "Should backend access to the model be allowed.", "type": "boolean" } */ /** Should backend access to the model be allowed. */ backendaccess?: boolean; /** * @swagger {components.schemas.RequestModel.properties} filename { "description": "Original name of the model's grasshopper file.", "type": "string" } */ /** Original name of the model's grasshopper file.*/ filename?: string; /** * @swagger {components.schemas.RequestModel.properties} ftype { "description": "File type of the model.", "$ref": "#/components/schemas/RequestModelFiletype" } */ /** File type of the model. */ ftype?: ShapeDiverRequestModelFiletype; /** * @swagger {components.schemas.RequestModel.properties} initial_warmup { "description": "Allows to control whether the model should be warmed up immediately after loading by running a computation. This increases the likelihood of following computation requests to be faster.", "type": "boolean" } */ /** Allows to control whether the model should be warmed up immediately after loading by running a computation. This increases the likelihood of following computation requests to be faster. */ initial_warmup?: boolean; /** * @swagger {components.schemas.RequestModel.properties} id2 { "description": "Optional second model ID.", "type": "string", "format": "uuid" } */ /** Optional second model ID. */ id2?: string; /** * @swagger {components.schemas.RequestModel.properties} max_comp_time { "description": "Maximum number of milliseconds allowed for computations of this model.", "type": "number" } */ /** Maximum number of milliseconds allowed for computations of this model. */ max_comp_time?: number; /** * @swagger {components.schemas.RequestModel.properties} max_export_size { "description": "Maximum number of bytes allowed to be exported from a model for a specific set of parameter values.", "type": "number" } */ /** Maximum number of bytes allowed to be exported from a model for a specific set of parameter values. */ max_export_size?: number; /** * @swagger {components.schemas.RequestModel.properties} max_idle_minutes { "description": "Maximum amount of minutes a loaded model may be unused before it gets unloaded.
Note: Models may get unloaded earlier than that.", "type": "number" } */ /** Maximum amount of minutes a loaded model may be unused before it gets unloaded.
Note: Models may get unloaded earlier than that. */ max_idle_minutes?: number; /** * @swagger {components.schemas.RequestModel.properties} max_model_size { "description": "Maximum number of bytes allowed for the model's Grasshopper file size.", "type": "number" } */ /** Maximum number of bytes allowed for the model's Grasshopper file size. */ max_model_size?: number; /** * @swagger {components.schemas.RequestModel.properties} max_output_size { "description": "Maximum number of bytes allowed for an output of a model for a specific set of parameter values.", "type": "number" } */ /** Maximum number of bytes allowed for an output of a model for a specific set of parameter values. */ max_output_size?: number; /** * @swagger {components.schemas.RequestModel.properties} max_texture_size { "description": "Allows to configure the maximum number of bytes allowed for a single texture.", "type": "number" } */ /** Allows to configure the maximum number of bytes allowed for a single texture. */ max_texture_size?: number; /** * @swagger {components.schemas.RequestModel.properties} max_wait_time { "description": "Maximum time a computation request may stay waiting before a further worker goes ahead regardless of whether it already has the model loaded, and regardless of num_loaded_max. This allows to configure a soft or a hard upper boundary for the number of loaded models.", "type": "number" } */ /** Maximum time a computation request may stay waiting before a further worker goes ahead regardless of whether it already has the model loaded, and regardless of {@link num_loaded_max}. This allows to configure a soft or a hard upper boundary for the number of loaded models. */ max_wait_time?: number; /** * @swagger {components.schemas.RequestModel.properties} name { "description": "Name of the model.", "type": "string" } */ /** Name of the model. */ name?: string; /** * @swagger {components.schemas.RequestModel.properties} num_loaded_max { "description": "Maximum number of workers that should have the model loaded at the same time.", "type": "number" } */ /** Maximum number of workers that should have the model loaded at the same time. */ num_loaded_max?: number; /** * @swagger {components.schemas.RequestModel.properties} num_loaded_min { "description": "Minimum number of workers which should have the model loaded once a session to the model gets opened.", "type": "number" } */ /** Minimum number of workers which should have the model loaded once a session to the model gets opened. */ num_loaded_min?: number; /** * @swagger {components.schemas.RequestModel.properties} num_preloaded_min { "description": "Minimum number of workers that should always have the model loaded, regardless of session activity. This allows to minimise the likelihood of computation requests being slower due to model loading.", "type": "number" } */ /** Minimum number of workers that should always have the model loaded, regardless of session activity. This allows to minimise the likelihood of computation requests being slower due to model loading. */ num_preloaded_min?: number; /** * @swagger {components.schemas.RequestModel.properties} org_id { "description": "Optional organization ID.", "type": "string" } */ /** Organization ID. */ org_id?: string; /** * @swagger {components.schemas.RequestModel.properties} prev_id { "description": "Model ID of this model's previous version.", "type": "string" } */ /** Model ID of this model's previous version. */ prev_id?: string; /** * @swagger {components.schemas.RequestModel.properties} pub { "description": "Allows public access (ignore `accessdomains`).", "type": "boolean" } * @swagger {components.schemas.RequestModel} required [ "pub" ] */ /** Allows public access (ignore {@link accessdomains}). */ pub?: boolean; /** * @swagger {components.schemas.RequestModel.properties} require_iframe { "description": "Enforces iframe embedding instead of direct embedding.", "type": "boolean" } */ /** Enforces iframe embedding instead of direct embedding. */ require_iframe?: boolean; /** * @swagger {components.schemas.RequestModel.properties} require_token { "description": "Enforces token-based authentication for this model.", "type": "boolean" } */ /** Enforces token-based authentication for this model. */ require_token?: boolean; /** * @swagger {components.schemas.RequestModel.properties} session_rate_limit { "description": "Limits the number of sessions that can be created by a specific IP address in one hour.", "type": "number" } */ /** Limits the number of sessions that can be created by a specific IP address in one hour. */ session_rate_limit?: number; /** * @swagger {components.schemas.RequestModel.properties} trust { "description": "Can this model be trusted (controls whether failed computations will be retried).", "$ref": "#/components/schemas/RequestModelTrustlevel" } */ /** Can this model be trusted (controls whether failed computations will be retried). */ trust?: ShapeDiverRequestModelTrustlevel; /** * @swagger {components.schemas.RequestModel.properties} use_cdn { "description": "Allows the usage of the CDN for fast content distribution.", "type": "boolean" } */ /** Allows the usage of the CDN for fast content distribution. */ use_cdn?: boolean; /** * @swagger {components.schemas.RequestModel.properties} user_id { "description": "Optional user ID.", "type": "string" } */ /** User ID. */ user_id?: string; /** * @swagger {components.schemas.RequestModel.properties} webhook_url { "description": "The webhook-url for updating the platform backend about model status changes.", "type": "string" } */ /** The webhook-url for updating the platform backend about model status changes. */ webhook_url?: string; /** * @swagger {components.schemas.RequestModel.properties} webhook_token { "description": "The webhook-token for authentication used by the webhook-url.", "type": "string" } */ /** The webhook-token for authentication used by the {@link webhook_url}. */ webhook_token?: string; /** * @swagger {components.schemas.RequestModel.properties} deny_scripts { "description": "Allows to control whether the model's Grasshopper file can contain scripts.", "type": "boolean" } */ /** Allows to control whether the model's Grasshopper file can contain scripts. */ deny_scripts?: boolean; } /** * @swagger {components.schemas} RequestParameterDefinition { "description": "Definition of model parameters.
A directory of parameter-IDs and parameter-definitions.", "type": "object", "additionalProperties": { "$ref": "#/components/schemas/RequestParameterDefinitionPart" } } */ /** Definition of model parameters.
A directory of parameter-IDs and parameter-definitions. */ export type ShapeDiverRequestParameterDefinition = { [paramId: string]: ShapeDiverRequestParameterDefinitionPart; }; /** * @swagger {components.schemas} RequestParameterDefinitionPart { "description": "Data for a single parameter definition.", "type": "object" } */ /** Data for a single parameter definition. */ export type ShapeDiverRequestParameterDefinitionPart = { /** * @swagger {components.schemas.RequestParameterDefinitionPart.properties} displayname { "description": "Parameter name to display instead of name.", "type": "string" } */ /** Parameter name to display instead of name. */ displayname?: string; /** * @swagger {components.schemas.RequestParameterDefinitionPart.properties} group { "anyOf": [ { "$ref": "#/components/schemas/RequestParameterDefinitionGroup" }, { "$ref": "#/components/schemas/NullObject" }, { "description": "Set to null to remove the parameter from the currently assigned group.", "type": "null" } ] } */ /** * Group of a parameter. * Set to `null` to remove the parameter from the currently assigned group. */ group?: ShapeDiverRequestParameterDefinitionGroup | ShapeDiverNullObject | null; /** * @swagger {components.schemas.RequestParameterDefinitionPart.properties} hidden { "description": "Controls whether the parameter should be hidden in the UI.", "type": "boolean" } */ /** Controls whether the parameter should be hidden in the UI. */ hidden?: boolean; /** * @swagger {components.schemas.RequestParameterDefinitionPart.properties} order { "description": "Ordering of the parameter in client applications.", "type": "number" } */ /** Ordering of the parameter in client applications. */ order?: number; /** * @swagger {components.schemas.RequestParameterDefinitionPart.properties} tooltip { "description": "Description that is shown as a tooltip in the clients.", "type": "string" } */ /** Description that is shown as a tooltip in the clients. */ tooltip?: string; /** * @swagger {components.schemas.RequestParameterDefinitionPart.properties} settings { "description": "Holds parameter-type specific information.", "type": "string" } */ /** Holds parameter-type specific information. */ settings?: Record; }; /** * @swagger {components.schemas} RequestParameterDefinitionGroup { "allOf": [ { "$ref": "#/components/schemas/CommonsGroup" }, { "description": "Group information of a parameter definition.", "type": "object" } ] } */ /** Group information of a parameter definition. */ export type ShapeDiverRequestParameterDefinitionGroup = ShapeDiverCommonsGroup;