mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
docs: audit, deploymentconfig, files, parameters (#5506)
* docs: audit, deploymentconfig, files, parameters * Fix: mark as binary * Fix: show format in docs * Fix: use .swaggo * Fix: swagger notice * Swagger notice
This commit is contained in:
@ -44,32 +44,34 @@ const (
|
||||
type ComputedParameter struct {
|
||||
Parameter
|
||||
SourceValue string `json:"source_value"`
|
||||
SchemaID uuid.UUID `json:"schema_id"`
|
||||
SchemaID uuid.UUID `json:"schema_id" format:"uuid"`
|
||||
DefaultSourceValue bool `json:"default_source_value"`
|
||||
}
|
||||
|
||||
// Parameter represents a set value for the scope.
|
||||
//
|
||||
// @Description Parameter represents a set value for the scope.
|
||||
type Parameter struct {
|
||||
ID uuid.UUID `json:"id" table:"id"`
|
||||
Scope ParameterScope `json:"scope" table:"scope"`
|
||||
ScopeID uuid.UUID `json:"scope_id" table:"scope id"`
|
||||
ID uuid.UUID `json:"id" table:"id" format:"uuid"`
|
||||
Scope ParameterScope `json:"scope" table:"scope" enums:"template,workspace,import_job"`
|
||||
ScopeID uuid.UUID `json:"scope_id" table:"scope id" format:"uuid"`
|
||||
Name string `json:"name" table:"name"`
|
||||
SourceScheme ParameterSourceScheme `json:"source_scheme" table:"source scheme" validate:"ne=none"`
|
||||
DestinationScheme ParameterDestinationScheme `json:"destination_scheme" table:"destination scheme" validate:"ne=none"`
|
||||
CreatedAt time.Time `json:"created_at" table:"created at"`
|
||||
UpdatedAt time.Time `json:"updated_at" table:"updated at"`
|
||||
SourceScheme ParameterSourceScheme `json:"source_scheme" table:"source scheme" validate:"ne=none" enums:"none,data"`
|
||||
DestinationScheme ParameterDestinationScheme `json:"destination_scheme" table:"destination scheme" validate:"ne=none" enums:"none,environment_variable,provisioner_variable"`
|
||||
CreatedAt time.Time `json:"created_at" table:"created at" format:"date-time"`
|
||||
UpdatedAt time.Time `json:"updated_at" table:"updated at" format:"date-time"`
|
||||
}
|
||||
|
||||
type ParameterSchema struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
JobID uuid.UUID `json:"job_id"`
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
JobID uuid.UUID `json:"job_id" format:"uuid"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
DefaultSourceScheme ParameterSourceScheme `json:"default_source_scheme"`
|
||||
DefaultSourceScheme ParameterSourceScheme `json:"default_source_scheme" enums:"none,data"`
|
||||
DefaultSourceValue string `json:"default_source_value"`
|
||||
AllowOverrideSource bool `json:"allow_override_source"`
|
||||
DefaultDestinationScheme ParameterDestinationScheme `json:"default_destination_scheme"`
|
||||
DefaultDestinationScheme ParameterDestinationScheme `json:"default_destination_scheme" enums:"none,environment_variable,provisioner_variable"`
|
||||
AllowOverrideDestination bool `json:"allow_override_destination"`
|
||||
DefaultRefresh string `json:"default_refresh"`
|
||||
RedisplayValue bool `json:"redisplay_value"`
|
||||
@ -96,8 +98,8 @@ type CreateParameterRequest struct {
|
||||
|
||||
Name string `json:"name" validate:"required"`
|
||||
SourceValue string `json:"source_value" validate:"required"`
|
||||
SourceScheme ParameterSourceScheme `json:"source_scheme" validate:"oneof=data,required"`
|
||||
DestinationScheme ParameterDestinationScheme `json:"destination_scheme" validate:"oneof=environment_variable provisioner_variable,required"`
|
||||
SourceScheme ParameterSourceScheme `json:"source_scheme" validate:"oneof=data,required" enums:"none,data"`
|
||||
DestinationScheme ParameterDestinationScheme `json:"destination_scheme" validate:"oneof=environment_variable provisioner_variable,required" enums:"none,environment_variable,provisioner_variable"`
|
||||
}
|
||||
|
||||
func (c *Client) CreateParameter(ctx context.Context, scope ParameterScope, id uuid.UUID, req CreateParameterRequest) (Parameter, error) {
|
||||
|
Reference in New Issue
Block a user