diff --git a/apps/cli/lib/src/openapi/ast/openapi_ast.dart b/apps/cli/lib/src/openapi/ast/openapi_ast.dart new file mode 100644 index 000000000..83c10e07e --- /dev/null +++ b/apps/cli/lib/src/openapi/ast/openapi_ast.dart @@ -0,0 +1,2312 @@ +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/json_object.dart'; +import 'package:celest_cli/src/openapi/ast/openapi_visitor.dart'; +import 'package:celest_cli/src/openapi/type/json_type.dart'; +import 'package:celest_cli/src/openapi/type/json_type_format.spec.dart'; +import 'package:collection/collection.dart'; +import 'package:http_parser/http_parser.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:meta/meta.dart'; +import 'package:pub_semver/pub_semver.dart'; +import 'package:yaml/yaml.dart'; + +part 'openapi_ast.g.dart'; +part 'openapi_reference.dart'; + +abstract interface class OpenApiNode { + String? get ref; + YamlNode? get node; + BuiltMap? get extensions; + + R accept(OpenApiVisitor visitor); + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg); +} + +@BuiltValue(instantiable: false) +sealed class OpenApiComponent> + implements OpenApiNode { + String? get summary; + String? get description; + + OpenApiComponentBuilder toBuilder(); + T rebuild(void Function(OpenApiComponentBuilder b) updates); +} + +/// Additional external documentation. +/// +/// https://spec.openapis.org/oas/v3.1.0#external-documentation-object +abstract class OpenApiExternalDocs + implements + Built, + OpenApiNode { + factory OpenApiExternalDocs({ + required String url, + String? description, + Map? extensions, + }) { + return _$OpenApiExternalDocs._( + url: url, + description: description, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiExternalDocs.build( + void Function(OpenApiExternalDocsBuilder) updates, + ) = _$OpenApiExternalDocs; + + OpenApiExternalDocs._(); + + /// REQUIRED. The URL for the target documentation. + /// This MUST be in the form of a URL. + String get url; + + /// A description of the target documentation. + /// CommonMark syntax MAY be used for rich text representation. + String? get description; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitExternalDocs(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitExternalDocs(this, arg); +} + +/// This is the root object of the OpenAPI document. +/// +/// https://spec.openapis.org/oas/v3.1.0#openapi-object +abstract class OpenApiDocument + implements Built, OpenApiNode { + factory OpenApiDocument({ + required Version version, + required OpenApiInfo info, + String? jsonSchemaDialect, + List? servers, + Map>? paths, + OpenApiComponents? components, + List? securityRequirements, + OpenApiExternalDocs? externalDocs, + List? tags, + Map? extensions, + }) { + return _$OpenApiDocument._( + version: version, + info: info, + jsonSchemaDialect: jsonSchemaDialect, + servers: (servers ?? [OpenApiServer(url: '/')]).build(), + paths: (paths ?? {}).build(), + components: components ?? OpenApiComponents(), + securityRequirements: (securityRequirements ?? []).build(), + externalDocs: externalDocs, + tags: (tags ?? []).build(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiDocument.build( + void Function(OpenApiDocumentBuilder) updates, + ) = _$OpenApiDocument; + + OpenApiDocument._(); + + /// REQUIRED. This string MUST be the version number of the OpenAPI + /// Specification that the OpenAPI document uses. + /// + /// The openapi field SHOULD be used by tooling to interpret the OpenAPI + /// document. + /// + /// This is not related to the API [OpenApiInfo.apiVersion] + /// (`info.version`) string. + @JsonKey(name: 'openapi') + Version get version; + + /// REQUIRED. Provides metadata about the API. + /// + /// The metadata MAY be used by tooling as required. + OpenApiInfo get info; + + /// The default value for the $schema keyword within Schema Objects contained + /// within this OAS document. + /// + /// This MUST be in the form of a URI. + String? get jsonSchemaDialect; + + /// An array of Server Objects, which provide connectivity information to a + /// target server. + /// + /// If the servers property is not provided, or is an empty array, the + /// default value would be a Server Object with a url value of /. + BuiltList get servers; + + /// The available paths and operations for the API. + /// + /// The key of this map is a relative path to an individual endpoint. + /// + /// The field name MUST begin with a forward slash (/). The path is appended + /// (no relative URL resolution) to the expanded URL from the Server Object's + /// [OpenApiServer.url] field in order to construct the full URL. + /// + /// Path templating is allowed. When matching URLs, concrete (non-templated) + /// paths would be matched before their templated counterparts. Templated + /// paths with the same hierarchy but different templated names MUST NOT + /// exist as they are identical. In case of ambiguous matching, it's up to + /// the tooling to decide which one to use. + BuiltMap> get paths; + + // TODO(dnys1): webhooks + + /// An element to hold various schemas for the specification. + /// + /// https://spec.openapis.org/oas/v3.1.0#components-object + OpenApiComponents get components; + + /// A declaration of which security mechanisms can be used across the API. + /// The list of values includes alternative security requirement objects that + /// can be used. Only one of the security requirement objects need to be valid + /// at any point in time. + /// + /// https://spec.openapis.org/oas/v3.1.0#security-requirement-object + BuiltList get securityRequirements; + + /// Additional external documentation. + OpenApiExternalDocs? get externalDocs; + + /// A list of tags used by the specification with additional metadata. + /// + /// The order of the tags can be used to reflect on their order by the parsing tools. + /// Not all tags that are used by the Operation Object must be declared. + /// The tags that are not declared MAY be organized randomly or based on the tools' logic. + /// Each tag name in the list MUST be unique. + /// + /// https://spec.openapis.org/oas/v3.1.0#tag-object + BuiltList get tags; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitDocument(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitDocument(this, arg); +} + +abstract class OpenApiInfo + implements Built, OpenApiNode { + factory OpenApiInfo({ + String? title, + String? description, + String? apiVersion, + OpenApiContact? contact, + OpenApiLicense? license, + Map? extensions, + }) { + return _$OpenApiInfo._( + title: title, + description: description, + apiVersion: apiVersion, + contact: contact, + license: license, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiInfo.build( + void Function(OpenApiInfoBuilder) updates, + ) = _$OpenApiInfo; + + OpenApiInfo._(); + + String? get title; + String? get description; + String? get apiVersion; + + /// The contact information for the exposed API. + OpenApiContact? get contact; + + /// The license information for the exposed API. + OpenApiLicense? get license; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitInfo(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitInfo(this, arg); +} + +/// License information for the exposed API. +abstract class OpenApiLicense + implements Built, OpenApiNode { + factory OpenApiLicense({ + required String name, + String? identifier, + String? url, + Map? extensions, + }) { + return _$OpenApiLicense._( + name: name, + identifier: identifier, + url: url, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiLicense.build( + void Function(OpenApiLicenseBuilder) updates, + ) = _$OpenApiLicense; + + OpenApiLicense._(); + + /// REQUIRED. The license name used for the API. + String get name; + + /// An [SPDX-Licenses] expression for the API. + /// + /// The identifier field is mutually exclusive of the url field. + String? get identifier; + + /// A URI for the license used for the API. + /// + /// This MUST be in the form of a URI. The url field is mutually exclusive of + /// the identifier field. + String? get url; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitLicense(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitLicense(this, arg); +} + +/// An object representing a Server. +/// +/// https://spec.openapis.org/oas/v3.1.0#server-object +abstract class OpenApiServer + implements Built, OpenApiNode { + factory OpenApiServer({ + required String url, + String? description, + Map? variables, + Map? extensions, + }) { + return _$OpenApiServer._( + url: url, + description: description, + variables: (variables ?? {}).build(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiServer.build( + void Function(OpenApiServerBuilder) updates, + ) = _$OpenApiServer; + + OpenApiServer._(); + + /// REQUIRED. A URL to the target host. + /// + /// This URL supports Server Variables and MAY be relative, to indicate that + /// the host location is relative to the location where the OpenAPI document + /// is being served. Variable substitutions will be made when a variable is + /// named in {brackets}. + String get url; + + // TODO(dnys1): Provide citation + /// May be relative or absolute. + Uri get uri => Uri.parse(url); + + /// An optional string describing the host designated by the URL. + /// + /// CommonMark syntax MAY be used for rich text representation. + String? get description; + + /// A map between a variable name and its value. + /// + /// The value is used for substitution in the server's URL template. + BuiltMap get variables; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitServer(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitServer(this, arg); +} + +/// An object representing a Server Variable for server URL template +/// substitution. +/// +/// https://spec.openapis.org/oas/v3.1.0#server-variable-object +abstract class OpenApiServerVariable + implements + Built, + OpenApiNode { + factory OpenApiServerVariable({ + required String name, + required String defaultValue, + String? description, + Iterable? enumValues, + Map? extensions, + }) { + return _$OpenApiServerVariable._( + name: name, + defaultValue: defaultValue, + description: description, + enumValues: enumValues?.toBuiltList(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiServerVariable.build( + void Function(OpenApiServerVariableBuilder) updates, + ) = _$OpenApiServerVariable; + + OpenApiServerVariable._(); + + String get name; + + /// An enumeration of string values to be used if the substitution options + /// are from a limited set. + /// + /// The array MUST NOT be empty if provided. + @JsonKey(name: 'enum') + BuiltList? get enumValues; + + /// REQUIRED. The default value to use for substitution, which SHALL be sent + /// if an alternate value is not supplied. + /// + /// Note this behavior is different than the Schema Object's treatment of + /// default values, because in those cases parameter values are optional. + /// If the enum is defined, the value MUST exist in the enum's values. + @JsonKey(name: 'default') + String get defaultValue; + + /// An optional description for the server variable. + /// + /// CommonMark syntax MAY be used for rich text representation. + String? get description; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitServerVariable(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitServerVariable(this, arg); +} + +final class OpenApiOperationType extends EnumClass { + const OpenApiOperationType._(super.name); + + static const OpenApiOperationType get = _$get; + static const OpenApiOperationType put = _$put; + static const OpenApiOperationType post = _$post; + static const OpenApiOperationType delete = _$delete; + static const OpenApiOperationType options = _$options; + static const OpenApiOperationType head = _$head; + static const OpenApiOperationType patch = _$patch; + static const OpenApiOperationType trace = _$trace; + + static BuiltSet get values => + _$OpenApiOperationTypeValues; + static OpenApiOperationType valueOf(String name) => + _$OpenApiOperationTypeValueOf(name); +} + +/// Holds the relative paths to the individual endpoints and their operations. +/// +/// The path is appended to the URL from the Server Object in order to construct +/// the full URL. +/// +/// The Paths MAY be empty, due to Access Control List (ACL) constraints. +/// +/// https://spec.openapis.org/oas/v3.1.0#path-item-object +abstract class OpenApiPathItem + implements + Built, + OpenApiComponent { + factory OpenApiPathItem({ + String? ref, + String? summary, + String? description, + Map? operations, + List>? parameters, + List? servers, + Map? extensions, + }) { + return _$OpenApiPathItem._( + ref: ref, + summary: summary, + description: description, + operations: (operations ?? const {}).build(), + parameters: (parameters ?? const []).build(), + servers: servers?.build(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiPathItem.build( + void Function(OpenApiPathItemBuilder) updates, + ) = _$OpenApiPathItem; + + OpenApiPathItem._(); + + /// An optional, string summary, intended to apply to all operations in this + /// path. + /// + /// https://spec.openapis.org/oas/v3.1.0#path-item-object + @override + String? get summary; + + /// An optional, string description, intended to apply to all operations in + /// this path. + /// + /// https://spec.openapis.org/oas/v3.1.0#path-item-object + @override + String? get description; + + /// A definition of the operations on this path. + /// + /// https://spec.openapis.org/oas/v3.1.0#path-item-object + BuiltMap get operations; + + /// An alternative server array to service all operations in this path. + BuiltList? get servers; + + /// A list of parameters that are applicable for all the operations described + /// under this path. + /// + /// These parameters can be overridden at the operation level, but cannot be + /// removed there. The list MUST NOT include duplicated parameters. + /// + /// https://spec.openapis.org/oas/v3.1.0#path-item-object + BuiltList> get parameters; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitPathItem(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitPathItem(this, arg); +} + +/// Describes a single API operation on a path. +/// +/// https://spec.openapis.org/oas/v3.1.0#operation-object +abstract class OpenApiOperation + implements Built, OpenApiNode { + factory OpenApiOperation({ + required OpenApiOperationType type, + List? tags, + String? summary, + String? description, + String? operationId, + List>? parameters, + OpenApiComponentOrRef? requestBody, + OpenApiComponentOrRef? defaultResponse, + Map>? responses, + bool? deprecated, + List? servers, + Map? extensions, + }) { + return _$OpenApiOperation._( + type: type, + tags: (tags ?? const []).build(), + summary: summary, + description: description, + operationId: operationId, + parameters: (parameters ?? const []).build(), + requestBody: requestBody, + defaultResponse: defaultResponse, + responses: (responses ?? const {}).build(), + deprecated: deprecated, + servers: servers?.build(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiOperation.build( + void Function(OpenApiOperationBuilder) updates, + ) = _$OpenApiOperation; + + OpenApiOperation._(); + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(OpenApiOperationBuilder b) { + // TODO: this is wrong but refresh on what to do in edge cases here + // if (b._defaultResponse != null && b.responses.build().containsKey(200)) { + // throw ArgumentError.value( + // b, + // 'operation', + // 'Cannot have both a default response and a 200 response', + // ); + // } + } + + /// REQUIRED. The type of the operation. + OpenApiOperationType get type; + + /// A list of tags for API documentation control. + /// + /// Tags can be used for logical grouping of operations by resources or any + /// other qualifier. + BuiltList get tags; + + /// A short summary of what the operation does. + String? get summary; + + /// A verbose explanation of the operation behavior. + /// + /// CommonMark syntax MAY be used for rich text representation. + String? get description; + + /// Additional external documentation for this operation. + // final OpenApiExternalDocumentation? externalDocs; + + /// A unique string used to identify the operation. + /// + /// The id MUST be unique among all operations described in the API. The + /// operationId value is case-sensitive. Tools and libraries MAY use the + /// operationId to uniquely identify an operation, therefore, it is + /// RECOMMENDED to follow common programming naming conventions. + String? get operationId; + + /// A list of parameters that are applicable for this operation. + /// + /// If a parameter is already defined at the Path Item, the new definition + /// will override it but can never remove it. + /// + /// The list MUST NOT include duplicated parameters. A unique parameter is + /// defined by a combination of a `name` and `location`. The list can use the + /// Reference Object to link to parameters that are defined at the OpenAPI + /// Object's components/parameters. + BuiltList> get parameters; + + /// The request body applicable for this operation. + /// + /// The requestBody is only supported in HTTP methods where the HTTP 1.1 + /// specification RFC7231 has explicitly defined semantics for request bodies. + /// + /// In other cases where the HTTP spec is vague (such as `GET`, `HEAD` and + /// `DELETE`), requestBody is permitted but does not have well-defined + /// semantics and SHOULD be avoided if possible. + OpenApiComponentOrRef? get requestBody; + + /// {@template openapi_response} + /// A container for the expected responses of an operation. + /// + /// The container maps a HTTP response code to the expected response. + /// + /// The documentation is not necessarily expected to cover all possible HTTP + /// response codes because they may not be known in advance. However, + /// documentation is expected to cover a successful operation response and + /// any known errors. + /// + /// The default MAY be used as a default response object for all HTTP codes + /// that are not covered individually by the Responses Object. + /// + /// The Responses Object MUST contain at least one response code, and if only + /// one response code is provided it SHOULD be the response for a successful + /// operation call. + /// {@endtemplate} + BuiltMap> + get responses; + + OpenApiComponentOrRef? get defaultResponse; + + /// A map of possible out-of band callbacks related to the parent operation. + /// + /// Each value in the map is a Path Item Object that describes a set of + /// requests that may be initiated by the API provider and the expected + /// responses. + // final Map callbacks; + + /// Declares this operation to be deprecated. + /// + /// Consumers SHOULD refrain from usage of the declared operation. + bool? get deprecated; + + /// The computed value of [deprecated]. + bool get isDeprecated => deprecated ?? false; + + /// A declaration of which security mechanisms can be used for this operation. + /// + /// The list of values includes alternative security requirement objects that + /// can be used. Only one of the security requirement objects need to be + /// satisfied to authorize a request. To make security optional, an empty + /// security requirement ({}) can be included in the array. + /// + /// This definition overrides any declared top-level security. To remove a + /// top-level security declaration, an empty array can be used. + // final List security; + + /// An alternative server array to service this operation. + /// + /// If an alternative server object is specified at the Path Item Object or + /// Root level, it will be overridden by this value. + /// + /// https://spec.openapis.org/oas/v3.1.0#operation-object + BuiltList? get servers; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitOperation(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitOperation(this, arg); +} + +@immutable +sealed class StatusCodeOrRange { + static StatusCodeOrRange? tryParse(String statusCode) { + if (int.tryParse(statusCode) case final code?) { + return StatusCode(code); + } + if (_validRanges.firstMatch(statusCode) case final match?) { + return StatusCodeRange(int.parse(match.group(1)!)); + } + return null; + } + + static final _validRanges = RegExp(r'^([1-5])XX$'); +} + +final class StatusCode implements StatusCodeOrRange { + const StatusCode(this.code); + + final int code; + + @override + bool operator ==(Object other) { + return identical(this, other) || other is StatusCode && other.code == code; + } + + @override + int get hashCode => code.hashCode; + + @override + String toString() => code.toString(); +} + +final class StatusCodeRange implements StatusCodeOrRange { + const StatusCodeRange(this.group); + + final int group; // e.g. 4, 5 + + @override + bool operator ==(Object other) { + return identical(this, other) || + other is StatusCodeRange && other.group == group; + } + + @override + int get hashCode => group.hashCode; + + @override + String toString() => '${group}XX'; +} + +final class OpenApiParameterLocation extends EnumClass { + const OpenApiParameterLocation._(super.name); + + static const OpenApiParameterLocation query = _$query; + static const OpenApiParameterLocation header = _$header; + static const OpenApiParameterLocation path = _$path; + static const OpenApiParameterLocation cookie = _$cookie; + + static BuiltSet get values => + _$OpenApiParameterLocationValues; + static OpenApiParameterLocation valueOf(String name) => + _$OpenApiParameterLocationValueOf(name); +} + +/// In order to support common ways of serializing simple parameters, a set of +/// style values are defined. +/// +/// https://spec.openapis.org/oas/v3.1.0#style-values +final class OpenApiParameterStyle extends EnumClass { + const OpenApiParameterStyle._(super.name); + + /// Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570). + /// + /// - Valid for `path` parameters. + /// - Valid for types: `primitive`, `array`, `object`. + static const OpenApiParameterStyle matrix = _$matrix; + + /// Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570). + /// + /// - Valid for `path` parameters. + /// - Valid for types: `primitive`, `array`, `object`. + static const OpenApiParameterStyle label = _$label; + + /// Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570). + /// + /// This option replaces `collectionFormat` with a `csv` (when explode is + /// `false`) or `multi` (when `explode` is true) value from OpenAPI 2.0. + /// + /// - Valid for parameters: `query`, `cookie`. + /// - Valid for types: `primitive`, `array`, `object`. + static const OpenApiParameterStyle form = _$form; + + /// Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570). + /// + /// This option replaces `collectionFormat` with a `csv` value from OpenAPI 2.0. + /// + /// - Valid for parameters: `path`, `header`. + /// - Valid for types: `array`. + static const OpenApiParameterStyle simple = _$simple; + + /// Space separated array or object values. + /// + /// This option replaces `collectionFormat` equal to `ssv` from OpenAPI 2.0. + /// + /// - Valid for parameters: `query`. + /// - Valid for types: `array`, `object`. + static const OpenApiParameterStyle spaceDelimited = _$spaceDelimited; + + /// Pipe separated array or object values. + /// + /// This option replaces `collectionFormat` equal to `pipes` from OpenAPI 2.0. + /// + /// - Valid for parameters: `query`. + /// - Valid for types: `array`, `object`. + static const OpenApiParameterStyle pipeDelimited = _$pipeDelimited; + + /// Provides a simple way of rendering nested objects using form parameters. + /// + /// Objects with properties of simple types are rendered as if they were + /// query parameters. + /// + /// - Valid for parameters: `query`. + /// - Valid for types: `object`. + static const OpenApiParameterStyle deepObject = _$deepObject; + + static BuiltSet get values => + _$OpenApiParameterStyleValues; + static OpenApiParameterStyle valueOf(String name) => + _$OpenApiParameterStyleValueOf(name); +} + +/// Describes a single operation parameter. +/// +/// A unique parameter is defined by a combination of a [name] and [location]. +/// +/// https://spec.openapis.org/oas/v3.1.0#parameter-object +abstract class OpenApiParameter + implements + Built, + OpenApiComponent { + factory OpenApiParameter({ + required String name, + required OpenApiParameterLocation location, + String? description, + bool? required, + bool? deprecated, + bool? allowEmptyValue, + OpenApiParameterStyle? style, + bool? explode, + bool? allowReserved, + OpenApiComponentOrRef? schema, + // Map examples = const {}, + // TODO: Or media type range. + (MediaType, OpenApiMediaType)? content, + Map? extensions, + }) { + return _$OpenApiParameter._( + name: name, + location: location, + description: description, + required: required, + deprecated: deprecated, + allowEmptyValue: allowEmptyValue, + style: style, + explode: explode, + allowReserved: allowReserved, + schema: schema, + // examples: examples.build(), + content: content, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiParameter.build( + void Function(OpenApiParameterBuilder) updates, + ) = _$OpenApiParameter; + + OpenApiParameter._(); + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(OpenApiParameterBuilder b) { + // For more complex scenarios, the content property can define the media type + // and schema of the parameter. A parameter MUST contain either a schema + // property, or a content property, but not both. When example or examples + // are provided in conjunction with the schema object, the example MUST follow + // the prescribed serialization strategy for the parameter. + // + // https://spec.openapis.org/oas/v3.1.0#parameter-object + if (b._schema != null && b.content != null || + b._schema == null && b.content == null) { + throw ArgumentError.value( + b, + 'parameter', + 'Exactly one of schema or content must be set', + ); + } + } + + /// REQUIRED. The name of the parameter. + /// + /// Parameter names are case sensitive. + /// + /// - If [location] is `path`, the [name] field MUST correspond to a template + /// expression occurring within a [OpenApiPathItem] key. + /// + /// - If [location] is `header` and the [name] field is `Accept`, `Content-Type` + /// or `Authorization`, the parameter definition SHALL be ignored. + /// + /// - For all other cases, the [name] corresponds to the parameter name used + /// by the in property. + String get name; + + /// REQUIRED. The location of the parameter. + OpenApiParameterLocation get location; + + /// A brief description of the parameter. + /// + /// This could contain examples of use. CommonMark syntax MAY be used for + /// rich text representation. + @override + String? get description; + + /// Determines whether this parameter is mandatory. + /// + /// If the parameter location is "path", this property is REQUIRED and its + /// value MUST be `true`. Otherwise, the property MAY be included and its + /// default value is `false`. + bool? get required; + + /// The computed value of [required]. + bool get isRequired => required ?? false; + + /// Specifies that a parameter is deprecated and SHOULD be transitioned out + /// of usage. + bool? get deprecated; + + /// The computed value of [deprecated]. + bool get isDeprecated => deprecated ?? false; + + /// Sets the ability to pass empty-valued parameters. + /// + /// This is valid only for query parameters and allows sending a parameter + /// with an empty value. + /// + /// Default value is false. + bool? get allowEmptyValue; + + /// Describes how the parameter value will be serialized depending on the + /// type of the parameter value. + /// + /// Default values (based on value of in): + /// - for query: form + /// - for path: simple + /// - for header: simple + /// - for cookie: form + OpenApiParameterStyle? get style; + + /// When this is true, parameter values of type `array` or `object` generate + /// separate parameters for each value of the array or key-value pair of the + /// map. + /// + /// For other types of parameters this property has no effect. When [style] is + /// `form`, the default value is `true`. For all other styles, the default value + /// is `false`. + bool? get explode; + + /// Determines whether the parameter value SHOULD allow reserved characters, + /// as defined by [RFC3986](https://tools.ietf.org/html/rfc3986). + /// + /// This property only applies to parameters with a location of query. The + /// default value is false. + /// + /// https://spec.openapis.org/oas/v3.1.0#parameter-object + bool? get allowReserved; + + /// The schema defining the type used for the parameter. + /// + /// https://spec.openapis.org/oas/v3.1.0#parameter-object + OpenApiComponentOrRef? get schema; + + /// Examples of the media type. + /// + /// Each example object SHOULD match the media type and specified schema if + /// present. + /// + /// https://spec.openapis.org/oas/v3.1.0#parameter-object + // final Map examples; + + /// A map containing the representations for the parameter. + /// + /// The key is the media type and the value describes it. The map MUST only + /// contain one entry. + /// + /// https://spec.openapis.org/oas/v3.1.0#parameter-object + // TODO: Or media type range. + (MediaType, OpenApiMediaType)? get content; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitParameter(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitParameter(this, arg); +} + +/// Each Media Type Object provides schema and examples for the media type identified by its key. +/// +/// https://spec.openapis.org/oas/v3.1.0#media-type-object +abstract class OpenApiMediaType + implements Built, OpenApiNode { + factory OpenApiMediaType({ + required OpenApiComponentOrRef schema, + // Map examples = const {}, + Map? encoding, + Map? extensions, + }) { + return _$OpenApiMediaType._( + schema: schema, + // examples: examples.build(), + encoding: (encoding ?? {}).build(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiMediaType.build( + void Function(OpenApiMediaTypeBuilder) updates, + ) = _$OpenApiMediaType; + + OpenApiMediaType._(); + + /// The schema defining the content of the request, response, or parameter. + OpenApiComponentOrRef get schema; + + /// Examples of the media type. + /// + /// Each example object SHOULD match the media type and specified schema if + /// present. + // final Map examples; + + /// A map between a property name and its encoding information. + /// + /// The key, being the property name, MUST exist in the schema as a property. + /// The encoding object SHALL only apply to [OpenApiOperation.requestBody] + /// objects when the media type is `multipart` or `application/x-www-form-urlencoded`. + BuiltMap get encoding; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitMediaType(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitMediaType(this, arg); +} + +/// Describes a single request body. +/// +/// https://spec.openapis.org/oas/v3.1.0#request-body-object +abstract class OpenApiRequestBody + implements + Built, + OpenApiComponent { + factory OpenApiRequestBody({ + // TODO: Or media type range. + required Map content, + String? description, + bool? required, + Map? extensions, + }) { + return _$OpenApiRequestBody._( + content: content.build(), + description: description, + required: required, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiRequestBody.build( + void Function(OpenApiRequestBodyBuilder) updates, + ) = _$OpenApiRequestBody; + + OpenApiRequestBody._(); + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(OpenApiRequestBodyBuilder b) { + if (b.content.isEmpty) { + throw ArgumentError.value( + b, + 'requestBody', + 'At least one content type must be provided', + ); + } + } + + /// REQUIRED. The content of the request body. + /// + /// The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) + /// and the value describes it. + /// + /// For requests that match multiple keys, only the most specific key is + /// applicable. e.g. `text/plain` overrides `text/*`. + // TODO: Or media type range. + BuiltMap get content; + + /// A brief description of the request body. + /// + /// This could contain examples of use. CommonMark syntax MAY be used for + /// rich text representation. + @override + String? get description; + + /// Determines if the request body is required in the request. + /// + /// Defaults to `false`. + bool? get required; + + /// The computed value of [required]. + bool get isRequired => required ?? false; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitRequestBody(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitRequestBody(this, arg); +} + +/// A single encoding definition applied to a single schema property. +/// +/// https://spec.openapis.org/oas/v3.1.0#encoding-object +abstract class OpenApiEncoding + implements Built, OpenApiNode { + factory OpenApiEncoding({ + required MediaType contentType, + Map> headers = const {}, + OpenApiParameterStyle? style, + bool? explode, + bool? allowReserved, + Map? extensions, + }) { + return _$OpenApiEncoding._( + contentType: contentType, + headers: headers.build(), + style: style, + explode: explode, + allowReserved: allowReserved, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiEncoding.build( + void Function(OpenApiEncodingBuilder) updates, + ) = _$OpenApiEncoding; + + OpenApiEncoding._(); + + /// The Content-Type for encoding a specific property. + /// + /// Default value depends on the property type: for `string` with `format` + /// being `binary` – `application/octet-stream`; for other primitive types – + /// `application/json`; for `object` – `application/json`; for `array` – the + /// default is defined based on the inner type. The value can be a specific + /// media type (e.g. `application/json`), a wildcard media type (e.g. `image/*`), + /// or a comma-separated list of the two types. + MediaType get contentType; + + /// A map allowing additional information to be provided as headers, for + /// example `Content-Disposition`. Content-Type is described separately and + /// SHALL be ignored in this section. This property SHALL be ignored if the + /// request body media type is not `multipart` or `application/x-www-form-urlencoded`. + BuiltMap> get headers; + + /// Describes how a specific property value will be serialized depending on + /// its type. + /// + /// This property SHALL be ignored if the request body media type is not + /// `application/x-www-form-urlencoded` or `multipart/form-data`. If a value + /// is explicitly defined, then the value of contentType (implicit or explicit) + /// SHALL be ignored. + OpenApiParameterStyle? get style; + + /// When this is true, property values of type `array` or `object` generate + /// separate parameters for each value of the array, or key-value pair of the + /// map. + /// + /// For other types of properties this property has no effect. + /// + /// When [style] is `form`, the default value is `true`. For all other styles, + /// the default value is `false`. + bool? get explode; + + /// The computed value of [explode]. + bool get shouldExplode => + explode ?? + switch (style) { + OpenApiParameterStyle.form => true, + _ => false, + }; + + /// Determines whether the parameter value SHOULD allow reserved characters, + /// as defined by [RFC3986](https://tools.ietf.org/html/rfc3986): `:/?#[]@!$&'()*+,;=` + /// + /// This property SHALL be ignored if the request body media type is not + /// `application/x-www-form-urlencoded` or `multipart/form-data`. If a value + /// is explicitly defined, then the value of [contentType] (implicit or + /// explicit) SHALL be ignored. + bool? get allowReserved; + + /// The computed value of [allowReserved]. + bool get allowsReserved => allowReserved ?? false; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitEncoding(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitEncoding(this, arg); +} + +/// {@macro openapi_response} +/// +/// https://spec.openapis.org/oas/v3.1.0#responses-object +abstract class OpenApiResponse + implements + Built, + OpenApiComponent { + factory OpenApiResponse({ + required StatusCodeOrRange? statusCode, + required String description, + Map>? headers, + Map? content, + // Map links = const {}, + Map? extensions, + }) { + return _$OpenApiResponse._( + statusCode: statusCode, + description: description, + headers: headers?.build(), + content: content?.build(), + // links: links, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiResponse.build( + void Function(OpenApiResponseBuilder) updates, + ) = _$OpenApiResponse; + + OpenApiResponse._(); + + StatusCodeOrRange? get statusCode; + + /// REQUIRED. A short description of the response. + /// + /// CommonMark syntax MAY be used for rich text representation. + @override + String get description; + + /// Maps a header name to its definition. + /// + /// [RFC7230](https://tools.ietf.org/html/rfc7230) states header names are + /// case insensitive. If a response header is defined with the name + /// "Content-Type", it SHALL be ignored. + /// + /// https://spec.openapis.org/oas/v3.1.0#responses-object + BuiltMap>? get headers; + + /// A map containing descriptions of potential response payloads. + /// + /// The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) + /// and the value describes it. For responses that match multiple keys, only + /// the most specific key is applicable. e.g. `text/plain` overrides `text/*`. + /// + /// https://spec.openapis.org/oas/v3.1.0#responses-object + BuiltMap? get content; + + /// A map of operations links that can be followed from the response. + /// + /// The key of the map is a short name for the link, following the naming + /// constraints of the names for Component Objects. + /// + /// https://spec.openapis.org/oas/v3.1.0#responses-object + // final Map links; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitResponse(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitResponse(this, arg); +} + +/// The Header Object follows the structure of the Parameter Object with the following changes: +/// +/// 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. +/// 2. `in` MUST NOT be specified, it is implicitly in `header`. +/// 3. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). +/// +/// https://spec.openapis.org/oas/v3.1.0#header-object +abstract class OpenApiHeader + implements + Built, + OpenApiComponent { + factory OpenApiHeader({ + required OpenApiComponentOrRef schema, + String? description, + bool? required, + bool? deprecated, + bool? allowEmptyValue, + OpenApiParameterStyle? style, + bool? explode, + bool? allowReserved, + (MediaType, OpenApiMediaType)? content, + Map? extensions, + }) { + return _$OpenApiHeader._( + schema: schema, + description: description, + required: required, + deprecated: deprecated, + allowEmptyValue: allowEmptyValue, + style: style, + explode: explode, + allowReserved: allowReserved, + content: content, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiHeader.build( + void Function(OpenApiHeaderBuilder) updates, + ) = _$OpenApiHeader; + + OpenApiHeader._(); + + /// The schema defining the type used for the parameter. + /// + /// https://spec.openapis.org/oas/v3.1.0#parameter-object + OpenApiComponentOrRef get schema; + + /// A brief description of the parameter. + /// + /// This could contain examples of use. CommonMark syntax MAY be used for + /// rich text representation. + @override + String? get description; + + /// Determines whether this parameter is mandatory. + /// + /// If the parameter location is "path", this property is REQUIRED and its + /// value MUST be `true`. Otherwise, the property MAY be included and its + /// default value is `false`. + bool? get required; + + /// The computed value of [required]. + bool get isRequired => required ?? false; + + /// Specifies that a parameter is deprecated and SHOULD be transitioned out + /// of usage. + bool? get deprecated; + + /// The computed value of [deprecated]. + bool get isDeprecated => deprecated ?? false; + + /// Sets the ability to pass empty-valued parameters. + /// + /// This is valid only for query parameters and allows sending a parameter + /// with an empty value. + /// + /// Default value is false. + bool? get allowEmptyValue; + + /// Describes how the parameter value will be serialized depending on the + /// type of the parameter value. + /// + /// Default values (based on value of in): + /// - for query: form + /// - for path: simple + /// - for header: simple + /// - for cookie: form + OpenApiParameterStyle? get style; + + /// When this is true, parameter values of type `array` or `object` generate + /// separate parameters for each value of the array or key-value pair of the + /// map. + /// + /// For other types of parameters this property has no effect. When [style] is + /// `form`, the default value is `true`. For all other styles, the default value + /// is `false`. + bool? get explode; + + /// Determines whether the parameter value SHOULD allow reserved characters, + /// as defined by [RFC3986](https://tools.ietf.org/html/rfc3986). + /// + /// This property only applies to parameters with a location of query. The + /// default value is false. + /// + /// https://spec.openapis.org/oas/v3.1.0#parameter-object + bool? get allowReserved; + + /// A map containing the representations for the parameter. + /// + /// The key is the media type and the value describes it. The map MUST only + /// contain one entry. + /// + /// https://spec.openapis.org/oas/v3.1.0#parameter-object + (MediaType, OpenApiMediaType)? get content; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitHeader(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitHeader(this, arg); +} + +/// Holds a set of reusable objects for different aspects of the OAS. +/// +/// All objects defined within the components object will have no effect on the +/// API unless they are explicitly referenced from properties outside the +/// components object. +/// +/// All the fixed fields of objects that MUST use keys that match the regular +/// expression: `^[a-zA-Z0-9\.\-_]+$` +/// +/// https://spec.openapis.org/oas/v3.1.0#components-object +abstract class OpenApiComponents + implements Built, OpenApiNode { + factory OpenApiComponents({ + Map? schemas, + Map? responses, + Map? parameters, + // Map examples = const {}, + Map? requestBodies, + Map? headers, + Map securitySchemes = const {}, + // Map links = const {}, + // Map callbacks = const {}, + Map? paths, + Map? extensions, + }) { + return _$OpenApiComponents._( + schemas: (schemas ?? {}).build(), + responses: (responses ?? {}).build(), + parameters: (parameters ?? {}).build(), + // examples: examples.build(), + requestBodies: (requestBodies ?? {}).build(), + headers: (headers ?? {}).build(), + securitySchemes: securitySchemes.build(), + // links: links.build(), + // callbacks: callbacks.build(), + paths: (paths ?? {}).build(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiComponents.build( + void Function(OpenApiComponentsBuilder) updates, + ) = _$OpenApiComponents; + + OpenApiComponents._(); + + /// An object to hold reusable Schema Objects. + BuiltMap get schemas; + + /// An object to hold reusable Response Objects. + BuiltMap get responses; + + /// An object to hold reusable Parameter Objects. + BuiltMap get parameters; + + /// An object to hold reusable Example Objects. + // final Map examples; + + /// An object to hold reusable Request Body Objects. + BuiltMap get requestBodies; + + /// An object to hold reusable Header Objects. + BuiltMap get headers; + + /// An object to hold reusable Security Scheme Objects. + BuiltMap get securitySchemes; + + /// An object to hold reusable Link Objects. + // final Map links; + + /// An object to hold reusable Callback Objects. + // final Map callbacks; + + /// An object to hold reusable Path Item Object. + BuiltMap get paths; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitComponents(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitComponents(this, arg); +} + +@immutable +sealed class ItemOrList { + T? get value; +} + +final class ItemValue implements ItemOrList { + const ItemValue(this.value); + + @override + final T value; + + @override + bool operator ==(Object other) { + return identical(this, other) || other is ItemValue && other.value == value; + } + + @override + int get hashCode => value.hashCode; + + @override + String toString() => value.toString(); +} + +final class ItemList extends DelegatingList + implements ItemOrList { + const ItemList(super.base); + + @override + T? get value => null; + + @override + bool operator ==(Object other) { + return identical(this, other) || + other is ItemList && ListEquality().equals(this, other); + } + + @override + int get hashCode => ListEquality().hash(this); + + @override + String toString() => '[${join(', ')}]'; +} + +/// The Schema Object allows the definition of input and output data types. +/// +/// These types can be objects, but also primitives and arrays. This object is +/// a superset of the JSON Schema Specification Draft 2020-12. +/// +/// For more information about the properties, see JSON Schema Core and JSON +/// Schema Validation. +/// +/// Unless stated otherwise, the property definitions follow those of JSON +/// Schema and do not add any additional semantics. Where JSON Schema indicates +/// that behavior is defined by the application (e.g. for annotations), OAS +/// also defers the definition of semantics to the application consuming the +/// OpenAPI document. +/// +/// https://spec.openapis.org/oas/v3.1.0#schema-object +abstract class OpenApiSchema + implements + Built, + OpenApiComponent { + factory OpenApiSchema({ + String? ref, + YamlNode? node, + String? name, + String? title, + String? description, + ItemOrList? type, + bool? nullable, + Iterable>? allOf, + Iterable>? oneOf, + Iterable>? anyOf, + // required OpenApiComponentOrRef? not, + OpenApiComponentOrRef? items, + int? maxItems, + int? minItems, + bool? uniqueItems, + Map>? properties, + OpenApiAdditionalProperties? additionalProperties, + int? maxProperties, + int? minProperties, + Iterable? required, + JsonTypeFormat? format, + Object? defaultValue, + num? multipleOf, + num? maximum, + bool? exclusiveMaximum, + num? minimum, + bool? exclusiveMinimum, + int? maxLength, + int? minLength, + String? pattern, + Iterable? enumValues, + bool? deprecated, + bool? readOnly, + bool? writeOnly, + OpenApiDiscriminator? discriminator, + Object? example, + Map? extensions, + }) { + return _$OpenApiSchema._( + ref: ref, + node: node, + name: name, + title: title, + description: description, + type: type, + nullable: nullable, + allOf: allOf?.toBuiltList(), + oneOf: oneOf?.toBuiltList(), + anyOf: anyOf?.toBuiltList(), + // not: not, + items: items, + maxItems: maxItems, + minItems: minItems, + uniqueItems: uniqueItems, + properties: properties?.build(), + additionalProperties: additionalProperties, + maxProperties: maxProperties, + minProperties: minProperties, + required: required?.toBuiltSet(), + format: format, + defaultValue: defaultValue, + multipleOf: multipleOf, + maximum: maximum, + exclusiveMaximum: exclusiveMaximum, + minimum: minimum, + exclusiveMinimum: exclusiveMinimum, + maxLength: maxLength, + minLength: minLength, + pattern: pattern, + enumValues: enumValues?.toBuiltSet(), + deprecated: deprecated, + readOnly: readOnly, + writeOnly: writeOnly, + discriminator: discriminator, + example: example == null ? null : JsonObject(example), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiSchema.build( + void Function(OpenApiSchemaBuilder) updates, + ) = _$OpenApiSchema; + + OpenApiSchema._(); + + /// The intrinsic name of the type, if any. + /// + /// This is the exact value from the source YAML and is not suitable for use + /// in Dart representations, unlike [name]. + String? get name; + + /// The value of this keyword MUST be either a string or an array. If it is + /// an array, elements of the array MUST be strings and MUST be unique. + /// + /// String values MUST be one of the six primitive types ("null", "boolean", + /// "object", "array", "number", or "string"), or "integer" which matches any + /// number with a zero fractional part. + /// + /// If the value of "type" is a string, then an instance validates + /// successfully if its type matches the type represented by the value of the + /// string. If the value of "type" is an array, then an instance validates + /// successfully if its type matches any of the types indicated by the strings + /// in the array. + /// + /// https://json-schema.org/draft/2020-12/json-schema-validation#name-type + ItemOrList? get type; + + bool? get nullable; + + BuiltList>? get allOf; + + BuiltList>? get oneOf; + + BuiltList>? get anyOf; + + // OpenApiComponentOrRef? get not; + + OpenApiComponentOrRef? get items; + + int? get maxItems; + + int? get minItems; + + bool? get uniqueItems; + + BuiltMap>? get properties; + + OpenApiAdditionalProperties? get additionalProperties; + + int? get maxProperties; + + int? get minProperties; + + /// The list of required properties, if any. + /// + /// The value of this keyword MUST be an array. Elements of this array, if + /// any, MUST be strings, and MUST be unique. + /// + /// An object instance is valid against this keyword if every item in the + /// array is the name of a property in the instance. + /// + /// Omitting this keyword has the same behavior as an empty array. + /// + /// https://json-schema.org/draft/2020-12/json-schema-validation#name-required + BuiltSet? get required; + + JsonTypeFormat? get format; + + num? get multipleOf; + + num? get maximum; + + bool? get exclusiveMaximum; + + num? get minimum; + + bool? get exclusiveMinimum; + + int? get maxLength; + + int? get minLength; + + String? get pattern; + + /// The value of this keyword MUST be an array. This array SHOULD have at + /// least one element. Elements in the array SHOULD be unique. + /// + /// An instance validates successfully against this keyword if its value is + /// equal to one of the elements in this keyword's array value. + /// + /// Elements in the array might be of any type, including `null`. + /// + /// https://json-schema.org/draft/2020-12/json-schema-validation#section-6.1.2 + BuiltSet? get enumValues; + + // const + // https://json-schema.org/draft/2020-12/json-schema-validation#section-6.1.3 + + /// Adds support for polymorphism. + /// + /// The discriminator is an object name that is used to differentiate between + /// other schemas which may satisfy the payload description. + /// + /// See Composition and Inheritance for more details. + /// + /// https://spec.openapis.org/oas/v3.1.0#schema-object + OpenApiDiscriminator? get discriminator; + + // xml + // externalDocs + + /// A free-form property to include an example of an instance for this schema. + /// + /// To represent examples that cannot be naturally represented in JSON or + /// YAML, a string value can be used to contain the example with escaping + /// where necessary. + /// + /// **Deprecated**: The example property has been deprecated in favor of the + /// JSON Schema examples keyword. Use of example is discouraged, and later + /// versions of this specification may remove it. + /// + /// https://spec.openapis.org/oas/v3.1.0#fixed-fields-19 + JsonObject? get example; + + /// Both [title] and [description] can be used to decorate a user interface + /// with information about the data produced by this user interface. A title + /// will preferably be short, whereas a description will provide explanation + /// about the purpose of the instance described by this schema. + /// + /// https://json-schema.org/draft/2020-12/json-schema-validation#name-title-and-description + String? get title; + + /// CommonMark syntax MAY be used for rich text representation. + @override + String? get description; + + /// Specifies that a schema is deprecated and SHOULD be transitioned out of usage. + bool? get deprecated; + + /// This keyword can be used to supply a default JSON value associated with a + /// particular schema. + /// + /// It is RECOMMENDED that a default value be valid against the associated + /// schema. + /// + /// https://json-schema.org/draft/2020-12/json-schema-validation#name-default + Object? get defaultValue; + + /// If "readOnly" has a value of boolean true, it indicates that the value of + /// the instance is managed exclusively by the owning authority, and attempts + /// by an application to modify the value of this property are expected to be + /// ignored or rejected by that owning authority. + /// + /// An instance document that is marked as "readOnly" for the entire document + /// MAY be ignored if sent to the owning authority, or MAY result in an error, + /// at the authority's discretion. + /// + /// These keywords can be used to assist in user interface instance + /// generation. In particular, an application MAY choose to use a widget that + /// hides input values as they are typed for write-only fields. + /// + /// https://json-schema.org/draft/2020-12/json-schema-validation#name-readonly-and-writeonly + bool? get readOnly; + + /// If "writeOnly" has a value of boolean true, it indicates that the value is + /// never present when the instance is retrieved from the owning authority. It + /// can be present when sent to the owning authority to update or create the + /// document (or the resource it represents), but it will not be included in + /// any updated or newly created version of the instance. + /// + /// An instance document that is marked as "writeOnly" for the entire document + /// MAY be returned as a blank document of some sort, or MAY produce an error + /// upon retrieval, or have the retrieval request ignored, at the authority's + /// discretion. + /// + /// For example, "readOnly" would be used to mark a database-generated serial + /// number as read-only, while "writeOnly" would be used to mark a password + /// input field. + /// + /// These keywords can be used to assist in user interface instance + /// generation. In particular, an application MAY choose to use a widget that + /// hides input values as they are typed for write-only fields. + /// + /// https://json-schema.org/draft/2020-12/json-schema-validation#name-readonly-and-writeonly + bool? get writeOnly; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitSchema(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitSchema(this, arg); +} + +abstract class OpenApiAdditionalProperties + implements + Built, + OpenApiNode { + factory OpenApiAdditionalProperties({ + bool? allow, + OpenApiComponentOrRef? schema, + }) { + assert( + allow != null || schema != null, + 'Either allow or schema must be provided', + ); + return _$OpenApiAdditionalProperties._( + allow: allow, + schema: schema, + ); + } + + factory OpenApiAdditionalProperties.build([ + void Function(OpenApiAdditionalPropertiesBuilder) updates, + ]) = _$OpenApiAdditionalProperties; + + OpenApiAdditionalProperties._(); + + bool? get allow; + + OpenApiComponentOrRef? get schema; + + @override + R accept(OpenApiVisitor visitor) => + visitor.visitAdditionalProperties(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitAdditionalProperties(this, arg); +} + +/// When request bodies or response payloads may be one of a number of different +/// schemas, a discriminator object can be used to aid in serialization, +/// deserialization, and validation. +/// +/// The discriminator is a specific object in a schema which is used to inform +/// the consumer of the document of an alternative schema based on the value +/// associated with it. +/// +/// When using the discriminator, inline schemas will not be considered. +/// +/// https://spec.openapis.org/oas/v3.1.0#discriminator-object +abstract class OpenApiDiscriminator + implements + Built, + OpenApiNode { + factory OpenApiDiscriminator({ + required String propertyName, + Map? mapping, + String? ref, + YamlNode? node, + Map? extensions, + }) { + return _$OpenApiDiscriminator._( + ref: ref, + node: node, + propertyName: propertyName, + mapping: mapping?.build(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiDiscriminator.build( + void Function(OpenApiDiscriminatorBuilder) updates, + ) = _$OpenApiDiscriminator; + + OpenApiDiscriminator._(); + + /// REQUIRED. The name of the property in the payload that will hold the + /// discriminator value. + String get propertyName; + + /// An object to hold mappings between payload values and schema names or + /// references. + /// + /// https://spec.openapis.org/oas/v3.1.0#discriminator-object + BuiltMap? get mapping; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitDiscriminator(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitDiscriminator(this, arg); +} + +/// Defines a security scheme that can be used by the operations. +/// +/// Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), +/// OAuth2's common flows (implicit, password, client credentials and authorization code) as defined in RFC6749, +/// and OpenID Connect Discovery. +/// +/// https://spec.openapis.org/oas/v3.1.0#security-scheme-object +abstract class OpenApiSecurityScheme + implements + Built, + OpenApiComponent { + factory OpenApiSecurityScheme({ + required OpenApiSecuritySchemeType type, + String? description, + String? name, + OpenApiParameterLocation? location, + String? scheme, + String? bearerFormat, + OpenApiOAuthFlows? flows, + String? openIdConnectUrl, + Map? extensions, + }) { + return _$OpenApiSecurityScheme._( + type: type, + description: description, + name: name, + location: location, + scheme: scheme, + bearerFormat: bearerFormat, + flows: flows, + openIdConnectUrl: openIdConnectUrl, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiSecurityScheme.build( + void Function(OpenApiSecuritySchemeBuilder) updates, + ) = _$OpenApiSecurityScheme; + + OpenApiSecurityScheme._(); + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(OpenApiSecuritySchemeBuilder b) { + switch (b.type) { + case OpenApiSecuritySchemeType.apiKey: + if (b.name == null || b.location == null) { + throw ArgumentError.value( + b, + 'securityScheme', + 'name and location are required for apiKey type', + ); + } + case OpenApiSecuritySchemeType.http: + if (b.scheme == null) { + throw ArgumentError.value( + b, + 'securityScheme', + 'scheme is required for http type', + ); + } + case OpenApiSecuritySchemeType.oauth2: + if (b._flows == null) { + throw ArgumentError.value( + b, + 'securityScheme', + 'flows is required for oauth2 type', + ); + } + case OpenApiSecuritySchemeType.openIdConnect: + if (b.openIdConnectUrl == null) { + throw ArgumentError.value( + b, + 'securityScheme', + 'openIdConnectUrl is required for openIdConnect type', + ); + } + } + } + + /// REQUIRED. The type of the security scheme. + OpenApiSecuritySchemeType get type; + + /// A short description for security scheme. + /// + /// CommonMark syntax MAY be used for rich text representation. + @override + String? get description; + + /// REQUIRED for apiKey. The name of the header, query or cookie parameter to be used. + String? get name; + + /// REQUIRED for apiKey. The location of the API key. + OpenApiParameterLocation? get location; + + /// REQUIRED for http. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235. + /// + /// The values used SHOULD be registered in the IANA Authentication Scheme registry. + String? get scheme; + + /// A hint to the client to identify how the bearer token is formatted. + /// + /// Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes. + String? get bearerFormat; + + /// REQUIRED for oauth2. An object containing configuration information for the flow types supported. + OpenApiOAuthFlows? get flows; + + /// REQUIRED for openIdConnect. OpenId Connect URL to discover OAuth2 configuration values. + /// + /// This MUST be in the form of a URL. + String? get openIdConnectUrl; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitSecurityScheme(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitSecurityScheme(this, arg); +} + +/// The type of the security scheme. +final class OpenApiSecuritySchemeType extends EnumClass { + const OpenApiSecuritySchemeType._(super.name); + + /// API key in header, query or cookie + static const OpenApiSecuritySchemeType apiKey = _$apiKey; + + /// HTTP authentication + static const OpenApiSecuritySchemeType http = _$http; + + /// OAuth2 authentication + static const OpenApiSecuritySchemeType oauth2 = _$oauth2; + + /// OpenID Connect authentication + static const OpenApiSecuritySchemeType openIdConnect = _$openIdConnect; + + static BuiltSet get values => + _$OpenApiSecuritySchemeTypeValues; + static OpenApiSecuritySchemeType valueOf(String name) => + _$OpenApiSecuritySchemeTypeValueOf(name); +} + +/// Allows configuration of the supported OAuth Flows. +/// +/// https://spec.openapis.org/oas/v3.1.0#oauth-flows-object +abstract class OpenApiOAuthFlows + implements Built, OpenApiNode { + factory OpenApiOAuthFlows({ + OpenApiOAuthFlow? implicit, + OpenApiOAuthFlow? password, + OpenApiOAuthFlow? clientCredentials, + OpenApiOAuthFlow? authorizationCode, + Map? extensions, + }) { + return _$OpenApiOAuthFlows._( + implicit: implicit, + password: password, + clientCredentials: clientCredentials, + authorizationCode: authorizationCode, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiOAuthFlows.build( + void Function(OpenApiOAuthFlowsBuilder) updates, + ) = _$OpenApiOAuthFlows; + + OpenApiOAuthFlows._(); + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(OpenApiOAuthFlowsBuilder b) { + if (b._implicit case final implicit?) { + if (implicit.authorizationUrl == null) { + throw ArgumentError.value( + b, + 'oauthFlows', + 'authorizationUrl is required for implicit flow', + ); + } + } + if (b._password case final password?) { + if (password.tokenUrl == null) { + throw ArgumentError.value( + b, + 'oauthFlows', + 'tokenUrl is required for password flow', + ); + } + } + if (b._clientCredentials case final clientCredentials?) { + if (clientCredentials.tokenUrl == null) { + throw ArgumentError.value( + b, + 'oauthFlows', + 'tokenUrl is required for clientCredentials flow', + ); + } + } + if (b._authorizationCode case final authorizationCode?) { + if (authorizationCode.authorizationUrl == null || + authorizationCode.tokenUrl == null) { + throw ArgumentError.value( + b, + 'oauthFlows', + 'authorizationUrl and tokenUrl are required for authorizationCode flow', + ); + } + } + } + + /// Configuration for the OAuth Implicit flow + OpenApiOAuthFlow? get implicit; + + /// Configuration for the OAuth Resource Owner Password flow + OpenApiOAuthFlow? get password; + + /// Configuration for the OAuth Client Credentials flow + OpenApiOAuthFlow? get clientCredentials; + + /// Configuration for the OAuth Authorization Code flow + OpenApiOAuthFlow? get authorizationCode; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitOAuthFlows(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitOAuthFlows(this, arg); +} + +/// Configuration details for a supported OAuth Flow +/// +/// https://spec.openapis.org/oas/v3.1.0#oauth-flow-object +abstract class OpenApiOAuthFlow + implements Built, OpenApiNode { + factory OpenApiOAuthFlow({ + String? authorizationUrl, + String? tokenUrl, + String? refreshUrl, + Map scopes = const {}, + Map? extensions, + }) { + return _$OpenApiOAuthFlow._( + authorizationUrl: authorizationUrl, + tokenUrl: tokenUrl, + refreshUrl: refreshUrl, + scopes: scopes.build(), + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiOAuthFlow.build( + void Function(OpenApiOAuthFlowBuilder) updates, + ) = _$OpenApiOAuthFlow; + + OpenApiOAuthFlow._(); + + /// REQUIRED. The authorization URL to be used for this flow. + /// + /// This MUST be in the form of a URL. + String? get authorizationUrl; + + /// REQUIRED. The token URL to be used for this flow. + /// + /// This MUST be in the form of a URL. + String? get tokenUrl; + + /// The URL to be used for obtaining refresh tokens. + /// + /// This MUST be in the form of a URL. + String? get refreshUrl; + + /// REQUIRED. The available scopes for the OAuth2 security scheme. + /// + /// A map between the scope name and a short description for it. + BuiltMap get scopes; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitOAuthFlow(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitOAuthFlow(this, arg); +} + +/// Lists the required security schemes to execute this operation. +/// +/// The name used for each property MUST correspond to a security scheme +/// declared in the Security Schemes under the Components Object. +/// +/// Security Requirement Objects that contain multiple schemes require that +/// all schemes MUST be satisfied for a request to be authorized. This enables +/// support for scenarios where multiple query parameters or HTTP headers are +/// required to convey security information. +/// +/// When a list of Security Requirement Objects is defined on the OpenAPI +/// Object or Operation Object, only one of the Security Requirement Objects +/// in the list needs to be satisfied to authorize the request. +/// +/// https://spec.openapis.org/oas/v3.1.0#security-requirement-object +abstract class OpenApiSecurityRequirement + implements + Built, + OpenApiNode { + factory OpenApiSecurityRequirement({ + Map> schemes = const {}, + }) { + return _$OpenApiSecurityRequirement._( + schemes: schemes.map((k, v) => MapEntry(k, v.build())).build(), + ); + } + + factory OpenApiSecurityRequirement.build( + void Function(OpenApiSecurityRequirementBuilder) updates, + ) = _$OpenApiSecurityRequirement; + + OpenApiSecurityRequirement._(); + + /// Each name MUST correspond to a security scheme which is declared in the + /// Security Schemes under the Components Object. If the security scheme is + /// of type "oauth2" or "openIdConnect", then the value is a list of scope + /// names required for the execution. For other security scheme types, the + /// array MUST be empty. + BuiltMap> get schemes; + + @override + R accept(OpenApiVisitor visitor) => + visitor.visitSecurityRequirement(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitSecurityRequirement(this, arg); +} + +/// Adds metadata to a single tag that is used by the Operation Object. +/// +/// It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. +/// +/// https://spec.openapis.org/oas/v3.1.0#tag-object +abstract class OpenApiTag + implements Built, OpenApiNode { + factory OpenApiTag({ + required String name, + String? description, + OpenApiExternalDocs? externalDocs, + Map? extensions, + }) { + return _$OpenApiTag._( + name: name, + description: description, + externalDocs: externalDocs, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiTag.build( + void Function(OpenApiTagBuilder) updates, + ) = _$OpenApiTag; + + OpenApiTag._(); + + /// REQUIRED. The name of the tag. + String get name; + + /// A description for the tag. + /// + /// CommonMark syntax MAY be used for rich text representation. + String? get description; + + /// Additional external documentation for this tag. + OpenApiExternalDocs? get externalDocs; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitTag(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitTag(this, arg); +} + +/// Contact information for the exposed API. +/// +/// https://spec.openapis.org/oas/v3.1.0#contact-object +abstract class OpenApiContact + implements Built, OpenApiNode { + factory OpenApiContact({ + String? name, + String? url, + String? email, + Map? extensions, + }) { + return _$OpenApiContact._( + name: name, + url: url, + email: email, + extensions: extensions?.map((k, v) => MapEntry(k, JsonObject(v))).build(), + ); + } + + factory OpenApiContact.build( + void Function(OpenApiContactBuilder) updates, + ) = _$OpenApiContact; + + OpenApiContact._(); + + /// The identifying name of the contact person/organization. + String? get name; + + /// The URL pointing to the contact information. + /// + /// This MUST be in the form of a URL. + String? get url; + + /// The email address of the contact person/organization. + /// + /// This MUST be in the form of an email address. + String? get email; + + @override + R accept(OpenApiVisitor visitor) => visitor.visitContact(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) => + visitor.visitContact(this, arg); +} diff --git a/apps/cli/lib/src/openapi/ast/openapi_ast.g.dart b/apps/cli/lib/src/openapi/ast/openapi_ast.g.dart new file mode 100644 index 000000000..d44ece834 --- /dev/null +++ b/apps/cli/lib/src/openapi/ast/openapi_ast.g.dart @@ -0,0 +1,6535 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'openapi_ast.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +const OpenApiOperationType _$get = const OpenApiOperationType._('get'); +const OpenApiOperationType _$put = const OpenApiOperationType._('put'); +const OpenApiOperationType _$post = const OpenApiOperationType._('post'); +const OpenApiOperationType _$delete = const OpenApiOperationType._('delete'); +const OpenApiOperationType _$options = const OpenApiOperationType._('options'); +const OpenApiOperationType _$head = const OpenApiOperationType._('head'); +const OpenApiOperationType _$patch = const OpenApiOperationType._('patch'); +const OpenApiOperationType _$trace = const OpenApiOperationType._('trace'); + +OpenApiOperationType _$OpenApiOperationTypeValueOf(String name) { + switch (name) { + case 'get': + return _$get; + case 'put': + return _$put; + case 'post': + return _$post; + case 'delete': + return _$delete; + case 'options': + return _$options; + case 'head': + return _$head; + case 'patch': + return _$patch; + case 'trace': + return _$trace; + default: + throw new ArgumentError(name); + } +} + +final BuiltSet _$OpenApiOperationTypeValues = + new BuiltSet(const [ + _$get, + _$put, + _$post, + _$delete, + _$options, + _$head, + _$patch, + _$trace, +]); + +const OpenApiParameterLocation _$query = + const OpenApiParameterLocation._('query'); +const OpenApiParameterLocation _$header = + const OpenApiParameterLocation._('header'); +const OpenApiParameterLocation _$path = + const OpenApiParameterLocation._('path'); +const OpenApiParameterLocation _$cookie = + const OpenApiParameterLocation._('cookie'); + +OpenApiParameterLocation _$OpenApiParameterLocationValueOf(String name) { + switch (name) { + case 'query': + return _$query; + case 'header': + return _$header; + case 'path': + return _$path; + case 'cookie': + return _$cookie; + default: + throw new ArgumentError(name); + } +} + +final BuiltSet _$OpenApiParameterLocationValues = + new BuiltSet(const [ + _$query, + _$header, + _$path, + _$cookie, +]); + +const OpenApiParameterStyle _$matrix = const OpenApiParameterStyle._('matrix'); +const OpenApiParameterStyle _$label = const OpenApiParameterStyle._('label'); +const OpenApiParameterStyle _$form = const OpenApiParameterStyle._('form'); +const OpenApiParameterStyle _$simple = const OpenApiParameterStyle._('simple'); +const OpenApiParameterStyle _$spaceDelimited = + const OpenApiParameterStyle._('spaceDelimited'); +const OpenApiParameterStyle _$pipeDelimited = + const OpenApiParameterStyle._('pipeDelimited'); +const OpenApiParameterStyle _$deepObject = + const OpenApiParameterStyle._('deepObject'); + +OpenApiParameterStyle _$OpenApiParameterStyleValueOf(String name) { + switch (name) { + case 'matrix': + return _$matrix; + case 'label': + return _$label; + case 'form': + return _$form; + case 'simple': + return _$simple; + case 'spaceDelimited': + return _$spaceDelimited; + case 'pipeDelimited': + return _$pipeDelimited; + case 'deepObject': + return _$deepObject; + default: + throw new ArgumentError(name); + } +} + +final BuiltSet _$OpenApiParameterStyleValues = + new BuiltSet(const [ + _$matrix, + _$label, + _$form, + _$simple, + _$spaceDelimited, + _$pipeDelimited, + _$deepObject, +]); + +const OpenApiSecuritySchemeType _$apiKey = + const OpenApiSecuritySchemeType._('apiKey'); +const OpenApiSecuritySchemeType _$http = + const OpenApiSecuritySchemeType._('http'); +const OpenApiSecuritySchemeType _$oauth2 = + const OpenApiSecuritySchemeType._('oauth2'); +const OpenApiSecuritySchemeType _$openIdConnect = + const OpenApiSecuritySchemeType._('openIdConnect'); + +OpenApiSecuritySchemeType _$OpenApiSecuritySchemeTypeValueOf(String name) { + switch (name) { + case 'apiKey': + return _$apiKey; + case 'http': + return _$http; + case 'oauth2': + return _$oauth2; + case 'openIdConnect': + return _$openIdConnect; + default: + throw new ArgumentError(name); + } +} + +final BuiltSet _$OpenApiSecuritySchemeTypeValues = + new BuiltSet(const [ + _$apiKey, + _$http, + _$oauth2, + _$openIdConnect, +]); + +abstract mixin class OpenApiComponentBuilder> { + void replace(OpenApiComponent other); + void update(void Function(OpenApiComponentBuilder) updates); + String? get summary; + set summary(String? summary); + + String? get description; + set description(String? description); + + String? get ref; + set ref(String? ref); + + YamlNode? get node; + set node(YamlNode? node); + + MapBuilder get extensions; + set extensions(MapBuilder? extensions); +} + +class _$OpenApiExternalDocs extends OpenApiExternalDocs { + @override + final String url; + @override + final String? description; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiExternalDocs( + [void Function(OpenApiExternalDocsBuilder)? updates]) => + (new OpenApiExternalDocsBuilder()..update(updates))._build(); + + _$OpenApiExternalDocs._( + {required this.url, + this.description, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull(url, r'OpenApiExternalDocs', 'url'); + } + + @override + OpenApiExternalDocs rebuild( + void Function(OpenApiExternalDocsBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiExternalDocsBuilder toBuilder() => + new OpenApiExternalDocsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiExternalDocs && + url == other.url && + description == other.description && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, url.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiExternalDocs') + ..add('url', url) + ..add('description', description) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiExternalDocsBuilder + implements Builder { + _$OpenApiExternalDocs? _$v; + + String? _url; + String? get url => _$this._url; + set url(String? url) => _$this._url = url; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiExternalDocsBuilder(); + + OpenApiExternalDocsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _url = $v.url; + _description = $v.description; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiExternalDocs other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiExternalDocs; + } + + @override + void update(void Function(OpenApiExternalDocsBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiExternalDocs build() => _build(); + + _$OpenApiExternalDocs _build() { + _$OpenApiExternalDocs _$result; + try { + _$result = _$v ?? + new _$OpenApiExternalDocs._( + url: BuiltValueNullFieldError.checkNotNull( + url, r'OpenApiExternalDocs', 'url'), + description: description, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiExternalDocs', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiDocument extends OpenApiDocument { + @override + final Version version; + @override + final OpenApiInfo info; + @override + final String? jsonSchemaDialect; + @override + final BuiltList servers; + @override + final BuiltMap> paths; + @override + final OpenApiComponents components; + @override + final BuiltList securityRequirements; + @override + final OpenApiExternalDocs? externalDocs; + @override + final BuiltList tags; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiDocument([void Function(OpenApiDocumentBuilder)? updates]) => + (new OpenApiDocumentBuilder()..update(updates))._build(); + + _$OpenApiDocument._( + {required this.version, + required this.info, + this.jsonSchemaDialect, + required this.servers, + required this.paths, + required this.components, + required this.securityRequirements, + this.externalDocs, + required this.tags, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + version, r'OpenApiDocument', 'version'); + BuiltValueNullFieldError.checkNotNull(info, r'OpenApiDocument', 'info'); + BuiltValueNullFieldError.checkNotNull( + servers, r'OpenApiDocument', 'servers'); + BuiltValueNullFieldError.checkNotNull(paths, r'OpenApiDocument', 'paths'); + BuiltValueNullFieldError.checkNotNull( + components, r'OpenApiDocument', 'components'); + BuiltValueNullFieldError.checkNotNull( + securityRequirements, r'OpenApiDocument', 'securityRequirements'); + BuiltValueNullFieldError.checkNotNull(tags, r'OpenApiDocument', 'tags'); + } + + @override + OpenApiDocument rebuild(void Function(OpenApiDocumentBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiDocumentBuilder toBuilder() => + new OpenApiDocumentBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiDocument && + version == other.version && + info == other.info && + jsonSchemaDialect == other.jsonSchemaDialect && + servers == other.servers && + paths == other.paths && + components == other.components && + securityRequirements == other.securityRequirements && + externalDocs == other.externalDocs && + tags == other.tags && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, version.hashCode); + _$hash = $jc(_$hash, info.hashCode); + _$hash = $jc(_$hash, jsonSchemaDialect.hashCode); + _$hash = $jc(_$hash, servers.hashCode); + _$hash = $jc(_$hash, paths.hashCode); + _$hash = $jc(_$hash, components.hashCode); + _$hash = $jc(_$hash, securityRequirements.hashCode); + _$hash = $jc(_$hash, externalDocs.hashCode); + _$hash = $jc(_$hash, tags.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiDocument') + ..add('version', version) + ..add('info', info) + ..add('jsonSchemaDialect', jsonSchemaDialect) + ..add('servers', servers) + ..add('paths', paths) + ..add('components', components) + ..add('securityRequirements', securityRequirements) + ..add('externalDocs', externalDocs) + ..add('tags', tags) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiDocumentBuilder + implements Builder { + _$OpenApiDocument? _$v; + + Version? _version; + Version? get version => _$this._version; + set version(Version? version) => _$this._version = version; + + OpenApiInfoBuilder? _info; + OpenApiInfoBuilder get info => _$this._info ??= new OpenApiInfoBuilder(); + set info(OpenApiInfoBuilder? info) => _$this._info = info; + + String? _jsonSchemaDialect; + String? get jsonSchemaDialect => _$this._jsonSchemaDialect; + set jsonSchemaDialect(String? jsonSchemaDialect) => + _$this._jsonSchemaDialect = jsonSchemaDialect; + + ListBuilder? _servers; + ListBuilder get servers => + _$this._servers ??= new ListBuilder(); + set servers(ListBuilder? servers) => _$this._servers = servers; + + MapBuilder>? _paths; + MapBuilder> get paths => + _$this._paths ??= + new MapBuilder>(); + set paths( + MapBuilder>? paths) => + _$this._paths = paths; + + OpenApiComponentsBuilder? _components; + OpenApiComponentsBuilder get components => + _$this._components ??= new OpenApiComponentsBuilder(); + set components(OpenApiComponentsBuilder? components) => + _$this._components = components; + + ListBuilder? _securityRequirements; + ListBuilder get securityRequirements => + _$this._securityRequirements ??= + new ListBuilder(); + set securityRequirements( + ListBuilder? securityRequirements) => + _$this._securityRequirements = securityRequirements; + + OpenApiExternalDocsBuilder? _externalDocs; + OpenApiExternalDocsBuilder get externalDocs => + _$this._externalDocs ??= new OpenApiExternalDocsBuilder(); + set externalDocs(OpenApiExternalDocsBuilder? externalDocs) => + _$this._externalDocs = externalDocs; + + ListBuilder? _tags; + ListBuilder get tags => + _$this._tags ??= new ListBuilder(); + set tags(ListBuilder? tags) => _$this._tags = tags; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiDocumentBuilder(); + + OpenApiDocumentBuilder get _$this { + final $v = _$v; + if ($v != null) { + _version = $v.version; + _info = $v.info.toBuilder(); + _jsonSchemaDialect = $v.jsonSchemaDialect; + _servers = $v.servers.toBuilder(); + _paths = $v.paths.toBuilder(); + _components = $v.components.toBuilder(); + _securityRequirements = $v.securityRequirements.toBuilder(); + _externalDocs = $v.externalDocs?.toBuilder(); + _tags = $v.tags.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiDocument other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiDocument; + } + + @override + void update(void Function(OpenApiDocumentBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiDocument build() => _build(); + + _$OpenApiDocument _build() { + _$OpenApiDocument _$result; + try { + _$result = _$v ?? + new _$OpenApiDocument._( + version: BuiltValueNullFieldError.checkNotNull( + version, r'OpenApiDocument', 'version'), + info: info.build(), + jsonSchemaDialect: jsonSchemaDialect, + servers: servers.build(), + paths: paths.build(), + components: components.build(), + securityRequirements: securityRequirements.build(), + externalDocs: _externalDocs?.build(), + tags: tags.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'info'; + info.build(); + + _$failedField = 'servers'; + servers.build(); + _$failedField = 'paths'; + paths.build(); + _$failedField = 'components'; + components.build(); + _$failedField = 'securityRequirements'; + securityRequirements.build(); + _$failedField = 'externalDocs'; + _externalDocs?.build(); + _$failedField = 'tags'; + tags.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiDocument', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiInfo extends OpenApiInfo { + @override + final String? title; + @override + final String? description; + @override + final String? apiVersion; + @override + final OpenApiContact? contact; + @override + final OpenApiLicense? license; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiInfo([void Function(OpenApiInfoBuilder)? updates]) => + (new OpenApiInfoBuilder()..update(updates))._build(); + + _$OpenApiInfo._( + {this.title, + this.description, + this.apiVersion, + this.contact, + this.license, + this.ref, + this.node, + this.extensions}) + : super._(); + + @override + OpenApiInfo rebuild(void Function(OpenApiInfoBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiInfoBuilder toBuilder() => new OpenApiInfoBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiInfo && + title == other.title && + description == other.description && + apiVersion == other.apiVersion && + contact == other.contact && + license == other.license && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, title.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, apiVersion.hashCode); + _$hash = $jc(_$hash, contact.hashCode); + _$hash = $jc(_$hash, license.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiInfo') + ..add('title', title) + ..add('description', description) + ..add('apiVersion', apiVersion) + ..add('contact', contact) + ..add('license', license) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiInfoBuilder implements Builder { + _$OpenApiInfo? _$v; + + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + String? _apiVersion; + String? get apiVersion => _$this._apiVersion; + set apiVersion(String? apiVersion) => _$this._apiVersion = apiVersion; + + OpenApiContactBuilder? _contact; + OpenApiContactBuilder get contact => + _$this._contact ??= new OpenApiContactBuilder(); + set contact(OpenApiContactBuilder? contact) => _$this._contact = contact; + + OpenApiLicenseBuilder? _license; + OpenApiLicenseBuilder get license => + _$this._license ??= new OpenApiLicenseBuilder(); + set license(OpenApiLicenseBuilder? license) => _$this._license = license; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiInfoBuilder(); + + OpenApiInfoBuilder get _$this { + final $v = _$v; + if ($v != null) { + _title = $v.title; + _description = $v.description; + _apiVersion = $v.apiVersion; + _contact = $v.contact?.toBuilder(); + _license = $v.license?.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiInfo other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiInfo; + } + + @override + void update(void Function(OpenApiInfoBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiInfo build() => _build(); + + _$OpenApiInfo _build() { + _$OpenApiInfo _$result; + try { + _$result = _$v ?? + new _$OpenApiInfo._( + title: title, + description: description, + apiVersion: apiVersion, + contact: _contact?.build(), + license: _license?.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'contact'; + _contact?.build(); + _$failedField = 'license'; + _license?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiInfo', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiLicense extends OpenApiLicense { + @override + final String name; + @override + final String? identifier; + @override + final String? url; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiLicense([void Function(OpenApiLicenseBuilder)? updates]) => + (new OpenApiLicenseBuilder()..update(updates))._build(); + + _$OpenApiLicense._( + {required this.name, + this.identifier, + this.url, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull(name, r'OpenApiLicense', 'name'); + } + + @override + OpenApiLicense rebuild(void Function(OpenApiLicenseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiLicenseBuilder toBuilder() => + new OpenApiLicenseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiLicense && + name == other.name && + identifier == other.identifier && + url == other.url && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, identifier.hashCode); + _$hash = $jc(_$hash, url.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiLicense') + ..add('name', name) + ..add('identifier', identifier) + ..add('url', url) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiLicenseBuilder + implements Builder { + _$OpenApiLicense? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _identifier; + String? get identifier => _$this._identifier; + set identifier(String? identifier) => _$this._identifier = identifier; + + String? _url; + String? get url => _$this._url; + set url(String? url) => _$this._url = url; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiLicenseBuilder(); + + OpenApiLicenseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _identifier = $v.identifier; + _url = $v.url; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiLicense other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiLicense; + } + + @override + void update(void Function(OpenApiLicenseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiLicense build() => _build(); + + _$OpenApiLicense _build() { + _$OpenApiLicense _$result; + try { + _$result = _$v ?? + new _$OpenApiLicense._( + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiLicense', 'name'), + identifier: identifier, + url: url, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiLicense', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiServer extends OpenApiServer { + @override + final String url; + @override + final String? description; + @override + final BuiltMap variables; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiServer([void Function(OpenApiServerBuilder)? updates]) => + (new OpenApiServerBuilder()..update(updates))._build(); + + _$OpenApiServer._( + {required this.url, + this.description, + required this.variables, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull(url, r'OpenApiServer', 'url'); + BuiltValueNullFieldError.checkNotNull( + variables, r'OpenApiServer', 'variables'); + } + + @override + OpenApiServer rebuild(void Function(OpenApiServerBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiServerBuilder toBuilder() => new OpenApiServerBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiServer && + url == other.url && + description == other.description && + variables == other.variables && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, url.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, variables.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiServer') + ..add('url', url) + ..add('description', description) + ..add('variables', variables) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiServerBuilder + implements Builder { + _$OpenApiServer? _$v; + + String? _url; + String? get url => _$this._url; + set url(String? url) => _$this._url = url; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + MapBuilder? _variables; + MapBuilder get variables => + _$this._variables ??= new MapBuilder(); + set variables(MapBuilder? variables) => + _$this._variables = variables; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiServerBuilder(); + + OpenApiServerBuilder get _$this { + final $v = _$v; + if ($v != null) { + _url = $v.url; + _description = $v.description; + _variables = $v.variables.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiServer other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiServer; + } + + @override + void update(void Function(OpenApiServerBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiServer build() => _build(); + + _$OpenApiServer _build() { + _$OpenApiServer _$result; + try { + _$result = _$v ?? + new _$OpenApiServer._( + url: BuiltValueNullFieldError.checkNotNull( + url, r'OpenApiServer', 'url'), + description: description, + variables: variables.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'variables'; + variables.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiServer', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiServerVariable extends OpenApiServerVariable { + @override + final String name; + @override + final BuiltList? enumValues; + @override + final String defaultValue; + @override + final String? description; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiServerVariable( + [void Function(OpenApiServerVariableBuilder)? updates]) => + (new OpenApiServerVariableBuilder()..update(updates))._build(); + + _$OpenApiServerVariable._( + {required this.name, + this.enumValues, + required this.defaultValue, + this.description, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiServerVariable', 'name'); + BuiltValueNullFieldError.checkNotNull( + defaultValue, r'OpenApiServerVariable', 'defaultValue'); + } + + @override + OpenApiServerVariable rebuild( + void Function(OpenApiServerVariableBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiServerVariableBuilder toBuilder() => + new OpenApiServerVariableBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiServerVariable && + name == other.name && + enumValues == other.enumValues && + defaultValue == other.defaultValue && + description == other.description && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, enumValues.hashCode); + _$hash = $jc(_$hash, defaultValue.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiServerVariable') + ..add('name', name) + ..add('enumValues', enumValues) + ..add('defaultValue', defaultValue) + ..add('description', description) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiServerVariableBuilder + implements Builder { + _$OpenApiServerVariable? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + ListBuilder? _enumValues; + ListBuilder get enumValues => + _$this._enumValues ??= new ListBuilder(); + set enumValues(ListBuilder? enumValues) => + _$this._enumValues = enumValues; + + String? _defaultValue; + String? get defaultValue => _$this._defaultValue; + set defaultValue(String? defaultValue) => _$this._defaultValue = defaultValue; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiServerVariableBuilder(); + + OpenApiServerVariableBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _enumValues = $v.enumValues?.toBuilder(); + _defaultValue = $v.defaultValue; + _description = $v.description; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiServerVariable other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiServerVariable; + } + + @override + void update(void Function(OpenApiServerVariableBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiServerVariable build() => _build(); + + _$OpenApiServerVariable _build() { + _$OpenApiServerVariable _$result; + try { + _$result = _$v ?? + new _$OpenApiServerVariable._( + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiServerVariable', 'name'), + enumValues: _enumValues?.build(), + defaultValue: BuiltValueNullFieldError.checkNotNull( + defaultValue, r'OpenApiServerVariable', 'defaultValue'), + description: description, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'enumValues'; + _enumValues?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiServerVariable', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiPathItem extends OpenApiPathItem { + @override + final String? summary; + @override + final String? description; + @override + final BuiltMap operations; + @override + final BuiltList? servers; + @override + final BuiltList> parameters; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiPathItem([void Function(OpenApiPathItemBuilder)? updates]) => + (new OpenApiPathItemBuilder()..update(updates))._build(); + + _$OpenApiPathItem._( + {this.summary, + this.description, + required this.operations, + this.servers, + required this.parameters, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + operations, r'OpenApiPathItem', 'operations'); + BuiltValueNullFieldError.checkNotNull( + parameters, r'OpenApiPathItem', 'parameters'); + } + + @override + OpenApiPathItem rebuild(void Function(OpenApiPathItemBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiPathItemBuilder toBuilder() => + new OpenApiPathItemBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiPathItem && + summary == other.summary && + description == other.description && + operations == other.operations && + servers == other.servers && + parameters == other.parameters && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, operations.hashCode); + _$hash = $jc(_$hash, servers.hashCode); + _$hash = $jc(_$hash, parameters.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiPathItem') + ..add('summary', summary) + ..add('description', description) + ..add('operations', operations) + ..add('servers', servers) + ..add('parameters', parameters) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiPathItemBuilder + implements + Builder, + OpenApiComponentBuilder { + _$OpenApiPathItem? _$v; + + String? _summary; + String? get summary => _$this._summary; + set summary(covariant String? summary) => _$this._summary = summary; + + String? _description; + String? get description => _$this._description; + set description(covariant String? description) => + _$this._description = description; + + MapBuilder? _operations; + MapBuilder get operations => + _$this._operations ??= + new MapBuilder(); + set operations( + covariant MapBuilder? + operations) => + _$this._operations = operations; + + ListBuilder? _servers; + ListBuilder get servers => + _$this._servers ??= new ListBuilder(); + set servers(covariant ListBuilder? servers) => + _$this._servers = servers; + + ListBuilder>? _parameters; + ListBuilder> get parameters => + _$this._parameters ??= + new ListBuilder>(); + set parameters( + covariant ListBuilder>? + parameters) => + _$this._parameters = parameters; + + String? _ref; + String? get ref => _$this._ref; + set ref(covariant String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(covariant YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(covariant MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiPathItemBuilder(); + + OpenApiPathItemBuilder get _$this { + final $v = _$v; + if ($v != null) { + _summary = $v.summary; + _description = $v.description; + _operations = $v.operations.toBuilder(); + _servers = $v.servers?.toBuilder(); + _parameters = $v.parameters.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant OpenApiPathItem other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiPathItem; + } + + @override + void update(void Function(OpenApiPathItemBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiPathItem build() => _build(); + + _$OpenApiPathItem _build() { + _$OpenApiPathItem _$result; + try { + _$result = _$v ?? + new _$OpenApiPathItem._( + summary: summary, + description: description, + operations: operations.build(), + servers: _servers?.build(), + parameters: parameters.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'operations'; + operations.build(); + _$failedField = 'servers'; + _servers?.build(); + _$failedField = 'parameters'; + parameters.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiPathItem', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiOperation extends OpenApiOperation { + @override + final OpenApiOperationType type; + @override + final BuiltList tags; + @override + final String? summary; + @override + final String? description; + @override + final String? operationId; + @override + final BuiltList> parameters; + @override + final OpenApiComponentOrRef? requestBody; + @override + final BuiltMap> + responses; + @override + final OpenApiComponentOrRef? defaultResponse; + @override + final bool? deprecated; + @override + final BuiltList? servers; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiOperation( + [void Function(OpenApiOperationBuilder)? updates]) => + (new OpenApiOperationBuilder()..update(updates))._build(); + + _$OpenApiOperation._( + {required this.type, + required this.tags, + this.summary, + this.description, + this.operationId, + required this.parameters, + this.requestBody, + required this.responses, + this.defaultResponse, + this.deprecated, + this.servers, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull(type, r'OpenApiOperation', 'type'); + BuiltValueNullFieldError.checkNotNull(tags, r'OpenApiOperation', 'tags'); + BuiltValueNullFieldError.checkNotNull( + parameters, r'OpenApiOperation', 'parameters'); + BuiltValueNullFieldError.checkNotNull( + responses, r'OpenApiOperation', 'responses'); + } + + @override + OpenApiOperation rebuild(void Function(OpenApiOperationBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiOperationBuilder toBuilder() => + new OpenApiOperationBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiOperation && + type == other.type && + tags == other.tags && + summary == other.summary && + description == other.description && + operationId == other.operationId && + parameters == other.parameters && + requestBody == other.requestBody && + responses == other.responses && + defaultResponse == other.defaultResponse && + deprecated == other.deprecated && + servers == other.servers && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, type.hashCode); + _$hash = $jc(_$hash, tags.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, operationId.hashCode); + _$hash = $jc(_$hash, parameters.hashCode); + _$hash = $jc(_$hash, requestBody.hashCode); + _$hash = $jc(_$hash, responses.hashCode); + _$hash = $jc(_$hash, defaultResponse.hashCode); + _$hash = $jc(_$hash, deprecated.hashCode); + _$hash = $jc(_$hash, servers.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiOperation') + ..add('type', type) + ..add('tags', tags) + ..add('summary', summary) + ..add('description', description) + ..add('operationId', operationId) + ..add('parameters', parameters) + ..add('requestBody', requestBody) + ..add('responses', responses) + ..add('defaultResponse', defaultResponse) + ..add('deprecated', deprecated) + ..add('servers', servers) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiOperationBuilder + implements Builder { + _$OpenApiOperation? _$v; + + OpenApiOperationType? _type; + OpenApiOperationType? get type => _$this._type; + set type(OpenApiOperationType? type) => _$this._type = type; + + ListBuilder? _tags; + ListBuilder get tags => _$this._tags ??= new ListBuilder(); + set tags(ListBuilder? tags) => _$this._tags = tags; + + String? _summary; + String? get summary => _$this._summary; + set summary(String? summary) => _$this._summary = summary; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + String? _operationId; + String? get operationId => _$this._operationId; + set operationId(String? operationId) => _$this._operationId = operationId; + + ListBuilder>? _parameters; + ListBuilder> get parameters => + _$this._parameters ??= + new ListBuilder>(); + set parameters( + ListBuilder>? parameters) => + _$this._parameters = parameters; + + OpenApiComponentOrRefBuilder? _requestBody; + OpenApiComponentOrRefBuilder get requestBody => + _$this._requestBody ??= + new OpenApiComponentOrRefBuilder(); + set requestBody( + OpenApiComponentOrRefBuilder? requestBody) => + _$this._requestBody = requestBody; + + MapBuilder>? + _responses; + MapBuilder> + get responses => _$this._responses ??= new MapBuilder>(); + set responses( + MapBuilder>? + responses) => + _$this._responses = responses; + + OpenApiComponentOrRefBuilder? _defaultResponse; + OpenApiComponentOrRefBuilder get defaultResponse => + _$this._defaultResponse ??= + new OpenApiComponentOrRefBuilder(); + set defaultResponse( + OpenApiComponentOrRefBuilder? defaultResponse) => + _$this._defaultResponse = defaultResponse; + + bool? _deprecated; + bool? get deprecated => _$this._deprecated; + set deprecated(bool? deprecated) => _$this._deprecated = deprecated; + + ListBuilder? _servers; + ListBuilder get servers => + _$this._servers ??= new ListBuilder(); + set servers(ListBuilder? servers) => _$this._servers = servers; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiOperationBuilder(); + + OpenApiOperationBuilder get _$this { + final $v = _$v; + if ($v != null) { + _type = $v.type; + _tags = $v.tags.toBuilder(); + _summary = $v.summary; + _description = $v.description; + _operationId = $v.operationId; + _parameters = $v.parameters.toBuilder(); + _requestBody = $v.requestBody?.toBuilder(); + _responses = $v.responses.toBuilder(); + _defaultResponse = $v.defaultResponse?.toBuilder(); + _deprecated = $v.deprecated; + _servers = $v.servers?.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiOperation other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiOperation; + } + + @override + void update(void Function(OpenApiOperationBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiOperation build() => _build(); + + _$OpenApiOperation _build() { + OpenApiOperation._validate(this); + _$OpenApiOperation _$result; + try { + _$result = _$v ?? + new _$OpenApiOperation._( + type: BuiltValueNullFieldError.checkNotNull( + type, r'OpenApiOperation', 'type'), + tags: tags.build(), + summary: summary, + description: description, + operationId: operationId, + parameters: parameters.build(), + requestBody: _requestBody?.build(), + responses: responses.build(), + defaultResponse: _defaultResponse?.build(), + deprecated: deprecated, + servers: _servers?.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'tags'; + tags.build(); + + _$failedField = 'parameters'; + parameters.build(); + _$failedField = 'requestBody'; + _requestBody?.build(); + _$failedField = 'responses'; + responses.build(); + _$failedField = 'defaultResponse'; + _defaultResponse?.build(); + + _$failedField = 'servers'; + _servers?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiOperation', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiParameter extends OpenApiParameter { + @override + final String name; + @override + final OpenApiParameterLocation location; + @override + final String? description; + @override + final bool? required; + @override + final bool? deprecated; + @override + final bool? allowEmptyValue; + @override + final OpenApiParameterStyle? style; + @override + final bool? explode; + @override + final bool? allowReserved; + @override + final OpenApiComponentOrRef? schema; + @override + final (MediaType, OpenApiMediaType)? content; + @override + final String? summary; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiParameter( + [void Function(OpenApiParameterBuilder)? updates]) => + (new OpenApiParameterBuilder()..update(updates))._build(); + + _$OpenApiParameter._( + {required this.name, + required this.location, + this.description, + this.required, + this.deprecated, + this.allowEmptyValue, + this.style, + this.explode, + this.allowReserved, + this.schema, + this.content, + this.summary, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull(name, r'OpenApiParameter', 'name'); + BuiltValueNullFieldError.checkNotNull( + location, r'OpenApiParameter', 'location'); + } + + @override + OpenApiParameter rebuild(void Function(OpenApiParameterBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiParameterBuilder toBuilder() => + new OpenApiParameterBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + final dynamic _$dynamicOther = other; + return other is OpenApiParameter && + name == other.name && + location == other.location && + description == other.description && + required == other.required && + deprecated == other.deprecated && + allowEmptyValue == other.allowEmptyValue && + style == other.style && + explode == other.explode && + allowReserved == other.allowReserved && + schema == other.schema && + content == _$dynamicOther.content && + summary == other.summary && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, location.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, required.hashCode); + _$hash = $jc(_$hash, deprecated.hashCode); + _$hash = $jc(_$hash, allowEmptyValue.hashCode); + _$hash = $jc(_$hash, style.hashCode); + _$hash = $jc(_$hash, explode.hashCode); + _$hash = $jc(_$hash, allowReserved.hashCode); + _$hash = $jc(_$hash, schema.hashCode); + _$hash = $jc(_$hash, content.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiParameter') + ..add('name', name) + ..add('location', location) + ..add('description', description) + ..add('required', required) + ..add('deprecated', deprecated) + ..add('allowEmptyValue', allowEmptyValue) + ..add('style', style) + ..add('explode', explode) + ..add('allowReserved', allowReserved) + ..add('schema', schema) + ..add('content', content) + ..add('summary', summary) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiParameterBuilder + implements + Builder, + OpenApiComponentBuilder { + _$OpenApiParameter? _$v; + + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; + + OpenApiParameterLocation? _location; + OpenApiParameterLocation? get location => _$this._location; + set location(covariant OpenApiParameterLocation? location) => + _$this._location = location; + + String? _description; + String? get description => _$this._description; + set description(covariant String? description) => + _$this._description = description; + + bool? _required; + bool? get required => _$this._required; + set required(covariant bool? required) => _$this._required = required; + + bool? _deprecated; + bool? get deprecated => _$this._deprecated; + set deprecated(covariant bool? deprecated) => _$this._deprecated = deprecated; + + bool? _allowEmptyValue; + bool? get allowEmptyValue => _$this._allowEmptyValue; + set allowEmptyValue(covariant bool? allowEmptyValue) => + _$this._allowEmptyValue = allowEmptyValue; + + OpenApiParameterStyle? _style; + OpenApiParameterStyle? get style => _$this._style; + set style(covariant OpenApiParameterStyle? style) => _$this._style = style; + + bool? _explode; + bool? get explode => _$this._explode; + set explode(covariant bool? explode) => _$this._explode = explode; + + bool? _allowReserved; + bool? get allowReserved => _$this._allowReserved; + set allowReserved(covariant bool? allowReserved) => + _$this._allowReserved = allowReserved; + + OpenApiComponentOrRefBuilder? _schema; + OpenApiComponentOrRefBuilder get schema => + _$this._schema ??= new OpenApiComponentOrRefBuilder(); + set schema(covariant OpenApiComponentOrRefBuilder? schema) => + _$this._schema = schema; + + (MediaType, OpenApiMediaType)? _content; + (MediaType, OpenApiMediaType)? get content => _$this._content; + set content(covariant (MediaType, OpenApiMediaType)? content) => + _$this._content = content; + + String? _summary; + String? get summary => _$this._summary; + set summary(covariant String? summary) => _$this._summary = summary; + + String? _ref; + String? get ref => _$this._ref; + set ref(covariant String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(covariant YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(covariant MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiParameterBuilder(); + + OpenApiParameterBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _location = $v.location; + _description = $v.description; + _required = $v.required; + _deprecated = $v.deprecated; + _allowEmptyValue = $v.allowEmptyValue; + _style = $v.style; + _explode = $v.explode; + _allowReserved = $v.allowReserved; + _schema = $v.schema?.toBuilder(); + _content = $v.content; + _summary = $v.summary; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant OpenApiParameter other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiParameter; + } + + @override + void update(void Function(OpenApiParameterBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiParameter build() => _build(); + + _$OpenApiParameter _build() { + OpenApiParameter._validate(this); + _$OpenApiParameter _$result; + try { + _$result = _$v ?? + new _$OpenApiParameter._( + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiParameter', 'name'), + location: BuiltValueNullFieldError.checkNotNull( + location, r'OpenApiParameter', 'location'), + description: description, + required: required, + deprecated: deprecated, + allowEmptyValue: allowEmptyValue, + style: style, + explode: explode, + allowReserved: allowReserved, + schema: _schema?.build(), + content: content, + summary: summary, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'schema'; + _schema?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiParameter', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiMediaType extends OpenApiMediaType { + @override + final OpenApiComponentOrRef schema; + @override + final BuiltMap encoding; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiMediaType( + [void Function(OpenApiMediaTypeBuilder)? updates]) => + (new OpenApiMediaTypeBuilder()..update(updates))._build(); + + _$OpenApiMediaType._( + {required this.schema, + required this.encoding, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + schema, r'OpenApiMediaType', 'schema'); + BuiltValueNullFieldError.checkNotNull( + encoding, r'OpenApiMediaType', 'encoding'); + } + + @override + OpenApiMediaType rebuild(void Function(OpenApiMediaTypeBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiMediaTypeBuilder toBuilder() => + new OpenApiMediaTypeBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiMediaType && + schema == other.schema && + encoding == other.encoding && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, schema.hashCode); + _$hash = $jc(_$hash, encoding.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiMediaType') + ..add('schema', schema) + ..add('encoding', encoding) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiMediaTypeBuilder + implements Builder { + _$OpenApiMediaType? _$v; + + OpenApiComponentOrRefBuilder? _schema; + OpenApiComponentOrRefBuilder get schema => + _$this._schema ??= new OpenApiComponentOrRefBuilder(); + set schema(OpenApiComponentOrRefBuilder? schema) => + _$this._schema = schema; + + MapBuilder? _encoding; + MapBuilder get encoding => + _$this._encoding ??= new MapBuilder(); + set encoding(MapBuilder? encoding) => + _$this._encoding = encoding; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiMediaTypeBuilder(); + + OpenApiMediaTypeBuilder get _$this { + final $v = _$v; + if ($v != null) { + _schema = $v.schema.toBuilder(); + _encoding = $v.encoding.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiMediaType other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiMediaType; + } + + @override + void update(void Function(OpenApiMediaTypeBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiMediaType build() => _build(); + + _$OpenApiMediaType _build() { + _$OpenApiMediaType _$result; + try { + _$result = _$v ?? + new _$OpenApiMediaType._( + schema: schema.build(), + encoding: encoding.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'schema'; + schema.build(); + _$failedField = 'encoding'; + encoding.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiMediaType', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiRequestBody extends OpenApiRequestBody { + @override + final BuiltMap content; + @override + final String? description; + @override + final bool? required; + @override + final String? summary; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiRequestBody( + [void Function(OpenApiRequestBodyBuilder)? updates]) => + (new OpenApiRequestBodyBuilder()..update(updates))._build(); + + _$OpenApiRequestBody._( + {required this.content, + this.description, + this.required, + this.summary, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + content, r'OpenApiRequestBody', 'content'); + } + + @override + OpenApiRequestBody rebuild( + void Function(OpenApiRequestBodyBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiRequestBodyBuilder toBuilder() => + new OpenApiRequestBodyBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiRequestBody && + content == other.content && + description == other.description && + required == other.required && + summary == other.summary && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, content.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, required.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiRequestBody') + ..add('content', content) + ..add('description', description) + ..add('required', required) + ..add('summary', summary) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiRequestBodyBuilder + implements + Builder, + OpenApiComponentBuilder { + _$OpenApiRequestBody? _$v; + + MapBuilder? _content; + MapBuilder get content => + _$this._content ??= new MapBuilder(); + set content(covariant MapBuilder? content) => + _$this._content = content; + + String? _description; + String? get description => _$this._description; + set description(covariant String? description) => + _$this._description = description; + + bool? _required; + bool? get required => _$this._required; + set required(covariant bool? required) => _$this._required = required; + + String? _summary; + String? get summary => _$this._summary; + set summary(covariant String? summary) => _$this._summary = summary; + + String? _ref; + String? get ref => _$this._ref; + set ref(covariant String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(covariant YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(covariant MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiRequestBodyBuilder(); + + OpenApiRequestBodyBuilder get _$this { + final $v = _$v; + if ($v != null) { + _content = $v.content.toBuilder(); + _description = $v.description; + _required = $v.required; + _summary = $v.summary; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant OpenApiRequestBody other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiRequestBody; + } + + @override + void update(void Function(OpenApiRequestBodyBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiRequestBody build() => _build(); + + _$OpenApiRequestBody _build() { + OpenApiRequestBody._validate(this); + _$OpenApiRequestBody _$result; + try { + _$result = _$v ?? + new _$OpenApiRequestBody._( + content: content.build(), + description: description, + required: required, + summary: summary, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'content'; + content.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiRequestBody', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiEncoding extends OpenApiEncoding { + @override + final MediaType contentType; + @override + final BuiltMap> headers; + @override + final OpenApiParameterStyle? style; + @override + final bool? explode; + @override + final bool? allowReserved; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiEncoding([void Function(OpenApiEncodingBuilder)? updates]) => + (new OpenApiEncodingBuilder()..update(updates))._build(); + + _$OpenApiEncoding._( + {required this.contentType, + required this.headers, + this.style, + this.explode, + this.allowReserved, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + contentType, r'OpenApiEncoding', 'contentType'); + BuiltValueNullFieldError.checkNotNull( + headers, r'OpenApiEncoding', 'headers'); + } + + @override + OpenApiEncoding rebuild(void Function(OpenApiEncodingBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiEncodingBuilder toBuilder() => + new OpenApiEncodingBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiEncoding && + contentType == other.contentType && + headers == other.headers && + style == other.style && + explode == other.explode && + allowReserved == other.allowReserved && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, contentType.hashCode); + _$hash = $jc(_$hash, headers.hashCode); + _$hash = $jc(_$hash, style.hashCode); + _$hash = $jc(_$hash, explode.hashCode); + _$hash = $jc(_$hash, allowReserved.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiEncoding') + ..add('contentType', contentType) + ..add('headers', headers) + ..add('style', style) + ..add('explode', explode) + ..add('allowReserved', allowReserved) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiEncodingBuilder + implements Builder { + _$OpenApiEncoding? _$v; + + MediaType? _contentType; + MediaType? get contentType => _$this._contentType; + set contentType(MediaType? contentType) => _$this._contentType = contentType; + + MapBuilder>? _headers; + MapBuilder> get headers => + _$this._headers ??= + new MapBuilder>(); + set headers( + MapBuilder>? headers) => + _$this._headers = headers; + + OpenApiParameterStyle? _style; + OpenApiParameterStyle? get style => _$this._style; + set style(OpenApiParameterStyle? style) => _$this._style = style; + + bool? _explode; + bool? get explode => _$this._explode; + set explode(bool? explode) => _$this._explode = explode; + + bool? _allowReserved; + bool? get allowReserved => _$this._allowReserved; + set allowReserved(bool? allowReserved) => + _$this._allowReserved = allowReserved; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiEncodingBuilder(); + + OpenApiEncodingBuilder get _$this { + final $v = _$v; + if ($v != null) { + _contentType = $v.contentType; + _headers = $v.headers.toBuilder(); + _style = $v.style; + _explode = $v.explode; + _allowReserved = $v.allowReserved; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiEncoding other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiEncoding; + } + + @override + void update(void Function(OpenApiEncodingBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiEncoding build() => _build(); + + _$OpenApiEncoding _build() { + _$OpenApiEncoding _$result; + try { + _$result = _$v ?? + new _$OpenApiEncoding._( + contentType: BuiltValueNullFieldError.checkNotNull( + contentType, r'OpenApiEncoding', 'contentType'), + headers: headers.build(), + style: style, + explode: explode, + allowReserved: allowReserved, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'headers'; + headers.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiEncoding', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiResponse extends OpenApiResponse { + @override + final StatusCodeOrRange? statusCode; + @override + final String description; + @override + final BuiltMap>? headers; + @override + final BuiltMap? content; + @override + final String? summary; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiResponse([void Function(OpenApiResponseBuilder)? updates]) => + (new OpenApiResponseBuilder()..update(updates))._build(); + + _$OpenApiResponse._( + {this.statusCode, + required this.description, + this.headers, + this.content, + this.summary, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + description, r'OpenApiResponse', 'description'); + } + + @override + OpenApiResponse rebuild(void Function(OpenApiResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiResponseBuilder toBuilder() => + new OpenApiResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiResponse && + statusCode == other.statusCode && + description == other.description && + headers == other.headers && + content == other.content && + summary == other.summary && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, statusCode.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, headers.hashCode); + _$hash = $jc(_$hash, content.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiResponse') + ..add('statusCode', statusCode) + ..add('description', description) + ..add('headers', headers) + ..add('content', content) + ..add('summary', summary) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiResponseBuilder + implements + Builder, + OpenApiComponentBuilder { + _$OpenApiResponse? _$v; + + StatusCodeOrRange? _statusCode; + StatusCodeOrRange? get statusCode => _$this._statusCode; + set statusCode(covariant StatusCodeOrRange? statusCode) => + _$this._statusCode = statusCode; + + String? _description; + String? get description => _$this._description; + set description(covariant String? description) => + _$this._description = description; + + MapBuilder>? _headers; + MapBuilder> get headers => + _$this._headers ??= + new MapBuilder>(); + set headers( + covariant MapBuilder>? + headers) => + _$this._headers = headers; + + MapBuilder? _content; + MapBuilder get content => + _$this._content ??= new MapBuilder(); + set content(covariant MapBuilder? content) => + _$this._content = content; + + String? _summary; + String? get summary => _$this._summary; + set summary(covariant String? summary) => _$this._summary = summary; + + String? _ref; + String? get ref => _$this._ref; + set ref(covariant String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(covariant YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(covariant MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiResponseBuilder(); + + OpenApiResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _statusCode = $v.statusCode; + _description = $v.description; + _headers = $v.headers?.toBuilder(); + _content = $v.content?.toBuilder(); + _summary = $v.summary; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant OpenApiResponse other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiResponse; + } + + @override + void update(void Function(OpenApiResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiResponse build() => _build(); + + _$OpenApiResponse _build() { + _$OpenApiResponse _$result; + try { + _$result = _$v ?? + new _$OpenApiResponse._( + statusCode: statusCode, + description: BuiltValueNullFieldError.checkNotNull( + description, r'OpenApiResponse', 'description'), + headers: _headers?.build(), + content: _content?.build(), + summary: summary, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'headers'; + _headers?.build(); + _$failedField = 'content'; + _content?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiHeader extends OpenApiHeader { + @override + final OpenApiComponentOrRef schema; + @override + final String? description; + @override + final bool? required; + @override + final bool? deprecated; + @override + final bool? allowEmptyValue; + @override + final OpenApiParameterStyle? style; + @override + final bool? explode; + @override + final bool? allowReserved; + @override + final (MediaType, OpenApiMediaType)? content; + @override + final String? summary; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiHeader([void Function(OpenApiHeaderBuilder)? updates]) => + (new OpenApiHeaderBuilder()..update(updates))._build(); + + _$OpenApiHeader._( + {required this.schema, + this.description, + this.required, + this.deprecated, + this.allowEmptyValue, + this.style, + this.explode, + this.allowReserved, + this.content, + this.summary, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull(schema, r'OpenApiHeader', 'schema'); + } + + @override + OpenApiHeader rebuild(void Function(OpenApiHeaderBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiHeaderBuilder toBuilder() => new OpenApiHeaderBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + final dynamic _$dynamicOther = other; + return other is OpenApiHeader && + schema == other.schema && + description == other.description && + required == other.required && + deprecated == other.deprecated && + allowEmptyValue == other.allowEmptyValue && + style == other.style && + explode == other.explode && + allowReserved == other.allowReserved && + content == _$dynamicOther.content && + summary == other.summary && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, schema.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, required.hashCode); + _$hash = $jc(_$hash, deprecated.hashCode); + _$hash = $jc(_$hash, allowEmptyValue.hashCode); + _$hash = $jc(_$hash, style.hashCode); + _$hash = $jc(_$hash, explode.hashCode); + _$hash = $jc(_$hash, allowReserved.hashCode); + _$hash = $jc(_$hash, content.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiHeader') + ..add('schema', schema) + ..add('description', description) + ..add('required', required) + ..add('deprecated', deprecated) + ..add('allowEmptyValue', allowEmptyValue) + ..add('style', style) + ..add('explode', explode) + ..add('allowReserved', allowReserved) + ..add('content', content) + ..add('summary', summary) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiHeaderBuilder + implements + Builder, + OpenApiComponentBuilder { + _$OpenApiHeader? _$v; + + OpenApiComponentOrRefBuilder? _schema; + OpenApiComponentOrRefBuilder get schema => + _$this._schema ??= new OpenApiComponentOrRefBuilder(); + set schema(covariant OpenApiComponentOrRefBuilder? schema) => + _$this._schema = schema; + + String? _description; + String? get description => _$this._description; + set description(covariant String? description) => + _$this._description = description; + + bool? _required; + bool? get required => _$this._required; + set required(covariant bool? required) => _$this._required = required; + + bool? _deprecated; + bool? get deprecated => _$this._deprecated; + set deprecated(covariant bool? deprecated) => _$this._deprecated = deprecated; + + bool? _allowEmptyValue; + bool? get allowEmptyValue => _$this._allowEmptyValue; + set allowEmptyValue(covariant bool? allowEmptyValue) => + _$this._allowEmptyValue = allowEmptyValue; + + OpenApiParameterStyle? _style; + OpenApiParameterStyle? get style => _$this._style; + set style(covariant OpenApiParameterStyle? style) => _$this._style = style; + + bool? _explode; + bool? get explode => _$this._explode; + set explode(covariant bool? explode) => _$this._explode = explode; + + bool? _allowReserved; + bool? get allowReserved => _$this._allowReserved; + set allowReserved(covariant bool? allowReserved) => + _$this._allowReserved = allowReserved; + + (MediaType, OpenApiMediaType)? _content; + (MediaType, OpenApiMediaType)? get content => _$this._content; + set content(covariant (MediaType, OpenApiMediaType)? content) => + _$this._content = content; + + String? _summary; + String? get summary => _$this._summary; + set summary(covariant String? summary) => _$this._summary = summary; + + String? _ref; + String? get ref => _$this._ref; + set ref(covariant String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(covariant YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(covariant MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiHeaderBuilder(); + + OpenApiHeaderBuilder get _$this { + final $v = _$v; + if ($v != null) { + _schema = $v.schema.toBuilder(); + _description = $v.description; + _required = $v.required; + _deprecated = $v.deprecated; + _allowEmptyValue = $v.allowEmptyValue; + _style = $v.style; + _explode = $v.explode; + _allowReserved = $v.allowReserved; + _content = $v.content; + _summary = $v.summary; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant OpenApiHeader other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiHeader; + } + + @override + void update(void Function(OpenApiHeaderBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiHeader build() => _build(); + + _$OpenApiHeader _build() { + _$OpenApiHeader _$result; + try { + _$result = _$v ?? + new _$OpenApiHeader._( + schema: schema.build(), + description: description, + required: required, + deprecated: deprecated, + allowEmptyValue: allowEmptyValue, + style: style, + explode: explode, + allowReserved: allowReserved, + content: content, + summary: summary, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'schema'; + schema.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiHeader', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiComponents extends OpenApiComponents { + @override + final BuiltMap schemas; + @override + final BuiltMap responses; + @override + final BuiltMap parameters; + @override + final BuiltMap requestBodies; + @override + final BuiltMap headers; + @override + final BuiltMap securitySchemes; + @override + final BuiltMap paths; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiComponents( + [void Function(OpenApiComponentsBuilder)? updates]) => + (new OpenApiComponentsBuilder()..update(updates))._build(); + + _$OpenApiComponents._( + {required this.schemas, + required this.responses, + required this.parameters, + required this.requestBodies, + required this.headers, + required this.securitySchemes, + required this.paths, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + schemas, r'OpenApiComponents', 'schemas'); + BuiltValueNullFieldError.checkNotNull( + responses, r'OpenApiComponents', 'responses'); + BuiltValueNullFieldError.checkNotNull( + parameters, r'OpenApiComponents', 'parameters'); + BuiltValueNullFieldError.checkNotNull( + requestBodies, r'OpenApiComponents', 'requestBodies'); + BuiltValueNullFieldError.checkNotNull( + headers, r'OpenApiComponents', 'headers'); + BuiltValueNullFieldError.checkNotNull( + securitySchemes, r'OpenApiComponents', 'securitySchemes'); + BuiltValueNullFieldError.checkNotNull(paths, r'OpenApiComponents', 'paths'); + } + + @override + OpenApiComponents rebuild(void Function(OpenApiComponentsBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiComponentsBuilder toBuilder() => + new OpenApiComponentsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiComponents && + schemas == other.schemas && + responses == other.responses && + parameters == other.parameters && + requestBodies == other.requestBodies && + headers == other.headers && + securitySchemes == other.securitySchemes && + paths == other.paths && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, schemas.hashCode); + _$hash = $jc(_$hash, responses.hashCode); + _$hash = $jc(_$hash, parameters.hashCode); + _$hash = $jc(_$hash, requestBodies.hashCode); + _$hash = $jc(_$hash, headers.hashCode); + _$hash = $jc(_$hash, securitySchemes.hashCode); + _$hash = $jc(_$hash, paths.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiComponents') + ..add('schemas', schemas) + ..add('responses', responses) + ..add('parameters', parameters) + ..add('requestBodies', requestBodies) + ..add('headers', headers) + ..add('securitySchemes', securitySchemes) + ..add('paths', paths) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiComponentsBuilder + implements Builder { + _$OpenApiComponents? _$v; + + MapBuilder? _schemas; + MapBuilder get schemas => + _$this._schemas ??= new MapBuilder(); + set schemas(MapBuilder? schemas) => + _$this._schemas = schemas; + + MapBuilder? _responses; + MapBuilder get responses => + _$this._responses ??= new MapBuilder(); + set responses(MapBuilder? responses) => + _$this._responses = responses; + + MapBuilder? _parameters; + MapBuilder get parameters => + _$this._parameters ??= new MapBuilder(); + set parameters(MapBuilder? parameters) => + _$this._parameters = parameters; + + MapBuilder? _requestBodies; + MapBuilder get requestBodies => + _$this._requestBodies ??= new MapBuilder(); + set requestBodies(MapBuilder? requestBodies) => + _$this._requestBodies = requestBodies; + + MapBuilder? _headers; + MapBuilder get headers => + _$this._headers ??= new MapBuilder(); + set headers(MapBuilder? headers) => + _$this._headers = headers; + + MapBuilder? _securitySchemes; + MapBuilder get securitySchemes => + _$this._securitySchemes ??= + new MapBuilder(); + set securitySchemes( + MapBuilder? securitySchemes) => + _$this._securitySchemes = securitySchemes; + + MapBuilder? _paths; + MapBuilder get paths => + _$this._paths ??= new MapBuilder(); + set paths(MapBuilder? paths) => + _$this._paths = paths; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiComponentsBuilder(); + + OpenApiComponentsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _schemas = $v.schemas.toBuilder(); + _responses = $v.responses.toBuilder(); + _parameters = $v.parameters.toBuilder(); + _requestBodies = $v.requestBodies.toBuilder(); + _headers = $v.headers.toBuilder(); + _securitySchemes = $v.securitySchemes.toBuilder(); + _paths = $v.paths.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiComponents other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiComponents; + } + + @override + void update(void Function(OpenApiComponentsBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiComponents build() => _build(); + + _$OpenApiComponents _build() { + _$OpenApiComponents _$result; + try { + _$result = _$v ?? + new _$OpenApiComponents._( + schemas: schemas.build(), + responses: responses.build(), + parameters: parameters.build(), + requestBodies: requestBodies.build(), + headers: headers.build(), + securitySchemes: securitySchemes.build(), + paths: paths.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'schemas'; + schemas.build(); + _$failedField = 'responses'; + responses.build(); + _$failedField = 'parameters'; + parameters.build(); + _$failedField = 'requestBodies'; + requestBodies.build(); + _$failedField = 'headers'; + headers.build(); + _$failedField = 'securitySchemes'; + securitySchemes.build(); + _$failedField = 'paths'; + paths.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiComponents', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiSchema extends OpenApiSchema { + @override + final String? name; + @override + final ItemOrList? type; + @override + final bool? nullable; + @override + final BuiltList>? allOf; + @override + final BuiltList>? oneOf; + @override + final BuiltList>? anyOf; + @override + final OpenApiComponentOrRef? items; + @override + final int? maxItems; + @override + final int? minItems; + @override + final bool? uniqueItems; + @override + final BuiltMap>? properties; + @override + final OpenApiAdditionalProperties? additionalProperties; + @override + final int? maxProperties; + @override + final int? minProperties; + @override + final BuiltSet? required; + @override + final JsonTypeFormat? format; + @override + final num? multipleOf; + @override + final num? maximum; + @override + final bool? exclusiveMaximum; + @override + final num? minimum; + @override + final bool? exclusiveMinimum; + @override + final int? maxLength; + @override + final int? minLength; + @override + final String? pattern; + @override + final BuiltSet? enumValues; + @override + final OpenApiDiscriminator? discriminator; + @override + final JsonObject? example; + @override + final String? title; + @override + final String? description; + @override + final bool? deprecated; + @override + final Object? defaultValue; + @override + final bool? readOnly; + @override + final bool? writeOnly; + @override + final String? summary; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiSchema([void Function(OpenApiSchemaBuilder)? updates]) => + (new OpenApiSchemaBuilder()..update(updates))._build(); + + _$OpenApiSchema._( + {this.name, + this.type, + this.nullable, + this.allOf, + this.oneOf, + this.anyOf, + this.items, + this.maxItems, + this.minItems, + this.uniqueItems, + this.properties, + this.additionalProperties, + this.maxProperties, + this.minProperties, + this.required, + this.format, + this.multipleOf, + this.maximum, + this.exclusiveMaximum, + this.minimum, + this.exclusiveMinimum, + this.maxLength, + this.minLength, + this.pattern, + this.enumValues, + this.discriminator, + this.example, + this.title, + this.description, + this.deprecated, + this.defaultValue, + this.readOnly, + this.writeOnly, + this.summary, + this.ref, + this.node, + this.extensions}) + : super._(); + + @override + OpenApiSchema rebuild(void Function(OpenApiSchemaBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiSchemaBuilder toBuilder() => new OpenApiSchemaBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiSchema && + name == other.name && + type == other.type && + nullable == other.nullable && + allOf == other.allOf && + oneOf == other.oneOf && + anyOf == other.anyOf && + items == other.items && + maxItems == other.maxItems && + minItems == other.minItems && + uniqueItems == other.uniqueItems && + properties == other.properties && + additionalProperties == other.additionalProperties && + maxProperties == other.maxProperties && + minProperties == other.minProperties && + required == other.required && + format == other.format && + multipleOf == other.multipleOf && + maximum == other.maximum && + exclusiveMaximum == other.exclusiveMaximum && + minimum == other.minimum && + exclusiveMinimum == other.exclusiveMinimum && + maxLength == other.maxLength && + minLength == other.minLength && + pattern == other.pattern && + enumValues == other.enumValues && + discriminator == other.discriminator && + example == other.example && + title == other.title && + description == other.description && + deprecated == other.deprecated && + defaultValue == other.defaultValue && + readOnly == other.readOnly && + writeOnly == other.writeOnly && + summary == other.summary && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, type.hashCode); + _$hash = $jc(_$hash, nullable.hashCode); + _$hash = $jc(_$hash, allOf.hashCode); + _$hash = $jc(_$hash, oneOf.hashCode); + _$hash = $jc(_$hash, anyOf.hashCode); + _$hash = $jc(_$hash, items.hashCode); + _$hash = $jc(_$hash, maxItems.hashCode); + _$hash = $jc(_$hash, minItems.hashCode); + _$hash = $jc(_$hash, uniqueItems.hashCode); + _$hash = $jc(_$hash, properties.hashCode); + _$hash = $jc(_$hash, additionalProperties.hashCode); + _$hash = $jc(_$hash, maxProperties.hashCode); + _$hash = $jc(_$hash, minProperties.hashCode); + _$hash = $jc(_$hash, required.hashCode); + _$hash = $jc(_$hash, format.hashCode); + _$hash = $jc(_$hash, multipleOf.hashCode); + _$hash = $jc(_$hash, maximum.hashCode); + _$hash = $jc(_$hash, exclusiveMaximum.hashCode); + _$hash = $jc(_$hash, minimum.hashCode); + _$hash = $jc(_$hash, exclusiveMinimum.hashCode); + _$hash = $jc(_$hash, maxLength.hashCode); + _$hash = $jc(_$hash, minLength.hashCode); + _$hash = $jc(_$hash, pattern.hashCode); + _$hash = $jc(_$hash, enumValues.hashCode); + _$hash = $jc(_$hash, discriminator.hashCode); + _$hash = $jc(_$hash, example.hashCode); + _$hash = $jc(_$hash, title.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, deprecated.hashCode); + _$hash = $jc(_$hash, defaultValue.hashCode); + _$hash = $jc(_$hash, readOnly.hashCode); + _$hash = $jc(_$hash, writeOnly.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiSchema') + ..add('name', name) + ..add('type', type) + ..add('nullable', nullable) + ..add('allOf', allOf) + ..add('oneOf', oneOf) + ..add('anyOf', anyOf) + ..add('items', items) + ..add('maxItems', maxItems) + ..add('minItems', minItems) + ..add('uniqueItems', uniqueItems) + ..add('properties', properties) + ..add('additionalProperties', additionalProperties) + ..add('maxProperties', maxProperties) + ..add('minProperties', minProperties) + ..add('required', required) + ..add('format', format) + ..add('multipleOf', multipleOf) + ..add('maximum', maximum) + ..add('exclusiveMaximum', exclusiveMaximum) + ..add('minimum', minimum) + ..add('exclusiveMinimum', exclusiveMinimum) + ..add('maxLength', maxLength) + ..add('minLength', minLength) + ..add('pattern', pattern) + ..add('enumValues', enumValues) + ..add('discriminator', discriminator) + ..add('example', example) + ..add('title', title) + ..add('description', description) + ..add('deprecated', deprecated) + ..add('defaultValue', defaultValue) + ..add('readOnly', readOnly) + ..add('writeOnly', writeOnly) + ..add('summary', summary) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiSchemaBuilder + implements + Builder, + OpenApiComponentBuilder { + _$OpenApiSchema? _$v; + + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; + + ItemOrList? _type; + ItemOrList? get type => _$this._type; + set type(covariant ItemOrList? type) => _$this._type = type; + + bool? _nullable; + bool? get nullable => _$this._nullable; + set nullable(covariant bool? nullable) => _$this._nullable = nullable; + + ListBuilder>? _allOf; + ListBuilder> get allOf => + _$this._allOf ??= new ListBuilder>(); + set allOf( + covariant ListBuilder>? allOf) => + _$this._allOf = allOf; + + ListBuilder>? _oneOf; + ListBuilder> get oneOf => + _$this._oneOf ??= new ListBuilder>(); + set oneOf( + covariant ListBuilder>? oneOf) => + _$this._oneOf = oneOf; + + ListBuilder>? _anyOf; + ListBuilder> get anyOf => + _$this._anyOf ??= new ListBuilder>(); + set anyOf( + covariant ListBuilder>? anyOf) => + _$this._anyOf = anyOf; + + OpenApiComponentOrRefBuilder? _items; + OpenApiComponentOrRefBuilder get items => + _$this._items ??= new OpenApiComponentOrRefBuilder(); + set items(covariant OpenApiComponentOrRefBuilder? items) => + _$this._items = items; + + int? _maxItems; + int? get maxItems => _$this._maxItems; + set maxItems(covariant int? maxItems) => _$this._maxItems = maxItems; + + int? _minItems; + int? get minItems => _$this._minItems; + set minItems(covariant int? minItems) => _$this._minItems = minItems; + + bool? _uniqueItems; + bool? get uniqueItems => _$this._uniqueItems; + set uniqueItems(covariant bool? uniqueItems) => + _$this._uniqueItems = uniqueItems; + + MapBuilder>? _properties; + MapBuilder> get properties => + _$this._properties ??= + new MapBuilder>(); + set properties( + covariant MapBuilder>? + properties) => + _$this._properties = properties; + + OpenApiAdditionalPropertiesBuilder? _additionalProperties; + OpenApiAdditionalPropertiesBuilder get additionalProperties => + _$this._additionalProperties ??= new OpenApiAdditionalPropertiesBuilder(); + set additionalProperties( + covariant OpenApiAdditionalPropertiesBuilder? additionalProperties) => + _$this._additionalProperties = additionalProperties; + + int? _maxProperties; + int? get maxProperties => _$this._maxProperties; + set maxProperties(covariant int? maxProperties) => + _$this._maxProperties = maxProperties; + + int? _minProperties; + int? get minProperties => _$this._minProperties; + set minProperties(covariant int? minProperties) => + _$this._minProperties = minProperties; + + SetBuilder? _required; + SetBuilder get required => + _$this._required ??= new SetBuilder(); + set required(covariant SetBuilder? required) => + _$this._required = required; + + JsonTypeFormat? _format; + JsonTypeFormat? get format => _$this._format; + set format(covariant JsonTypeFormat? format) => _$this._format = format; + + num? _multipleOf; + num? get multipleOf => _$this._multipleOf; + set multipleOf(covariant num? multipleOf) => _$this._multipleOf = multipleOf; + + num? _maximum; + num? get maximum => _$this._maximum; + set maximum(covariant num? maximum) => _$this._maximum = maximum; + + bool? _exclusiveMaximum; + bool? get exclusiveMaximum => _$this._exclusiveMaximum; + set exclusiveMaximum(covariant bool? exclusiveMaximum) => + _$this._exclusiveMaximum = exclusiveMaximum; + + num? _minimum; + num? get minimum => _$this._minimum; + set minimum(covariant num? minimum) => _$this._minimum = minimum; + + bool? _exclusiveMinimum; + bool? get exclusiveMinimum => _$this._exclusiveMinimum; + set exclusiveMinimum(covariant bool? exclusiveMinimum) => + _$this._exclusiveMinimum = exclusiveMinimum; + + int? _maxLength; + int? get maxLength => _$this._maxLength; + set maxLength(covariant int? maxLength) => _$this._maxLength = maxLength; + + int? _minLength; + int? get minLength => _$this._minLength; + set minLength(covariant int? minLength) => _$this._minLength = minLength; + + String? _pattern; + String? get pattern => _$this._pattern; + set pattern(covariant String? pattern) => _$this._pattern = pattern; + + SetBuilder? _enumValues; + SetBuilder get enumValues => + _$this._enumValues ??= new SetBuilder(); + set enumValues(covariant SetBuilder? enumValues) => + _$this._enumValues = enumValues; + + OpenApiDiscriminatorBuilder? _discriminator; + OpenApiDiscriminatorBuilder get discriminator => + _$this._discriminator ??= new OpenApiDiscriminatorBuilder(); + set discriminator(covariant OpenApiDiscriminatorBuilder? discriminator) => + _$this._discriminator = discriminator; + + JsonObject? _example; + JsonObject? get example => _$this._example; + set example(covariant JsonObject? example) => _$this._example = example; + + String? _title; + String? get title => _$this._title; + set title(covariant String? title) => _$this._title = title; + + String? _description; + String? get description => _$this._description; + set description(covariant String? description) => + _$this._description = description; + + bool? _deprecated; + bool? get deprecated => _$this._deprecated; + set deprecated(covariant bool? deprecated) => _$this._deprecated = deprecated; + + Object? _defaultValue; + Object? get defaultValue => _$this._defaultValue; + set defaultValue(covariant Object? defaultValue) => + _$this._defaultValue = defaultValue; + + bool? _readOnly; + bool? get readOnly => _$this._readOnly; + set readOnly(covariant bool? readOnly) => _$this._readOnly = readOnly; + + bool? _writeOnly; + bool? get writeOnly => _$this._writeOnly; + set writeOnly(covariant bool? writeOnly) => _$this._writeOnly = writeOnly; + + String? _summary; + String? get summary => _$this._summary; + set summary(covariant String? summary) => _$this._summary = summary; + + String? _ref; + String? get ref => _$this._ref; + set ref(covariant String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(covariant YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(covariant MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiSchemaBuilder(); + + OpenApiSchemaBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _type = $v.type; + _nullable = $v.nullable; + _allOf = $v.allOf?.toBuilder(); + _oneOf = $v.oneOf?.toBuilder(); + _anyOf = $v.anyOf?.toBuilder(); + _items = $v.items?.toBuilder(); + _maxItems = $v.maxItems; + _minItems = $v.minItems; + _uniqueItems = $v.uniqueItems; + _properties = $v.properties?.toBuilder(); + _additionalProperties = $v.additionalProperties?.toBuilder(); + _maxProperties = $v.maxProperties; + _minProperties = $v.minProperties; + _required = $v.required?.toBuilder(); + _format = $v.format; + _multipleOf = $v.multipleOf; + _maximum = $v.maximum; + _exclusiveMaximum = $v.exclusiveMaximum; + _minimum = $v.minimum; + _exclusiveMinimum = $v.exclusiveMinimum; + _maxLength = $v.maxLength; + _minLength = $v.minLength; + _pattern = $v.pattern; + _enumValues = $v.enumValues?.toBuilder(); + _discriminator = $v.discriminator?.toBuilder(); + _example = $v.example; + _title = $v.title; + _description = $v.description; + _deprecated = $v.deprecated; + _defaultValue = $v.defaultValue; + _readOnly = $v.readOnly; + _writeOnly = $v.writeOnly; + _summary = $v.summary; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant OpenApiSchema other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiSchema; + } + + @override + void update(void Function(OpenApiSchemaBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiSchema build() => _build(); + + _$OpenApiSchema _build() { + _$OpenApiSchema _$result; + try { + _$result = _$v ?? + new _$OpenApiSchema._( + name: name, + type: type, + nullable: nullable, + allOf: _allOf?.build(), + oneOf: _oneOf?.build(), + anyOf: _anyOf?.build(), + items: _items?.build(), + maxItems: maxItems, + minItems: minItems, + uniqueItems: uniqueItems, + properties: _properties?.build(), + additionalProperties: _additionalProperties?.build(), + maxProperties: maxProperties, + minProperties: minProperties, + required: _required?.build(), + format: format, + multipleOf: multipleOf, + maximum: maximum, + exclusiveMaximum: exclusiveMaximum, + minimum: minimum, + exclusiveMinimum: exclusiveMinimum, + maxLength: maxLength, + minLength: minLength, + pattern: pattern, + enumValues: _enumValues?.build(), + discriminator: _discriminator?.build(), + example: example, + title: title, + description: description, + deprecated: deprecated, + defaultValue: defaultValue, + readOnly: readOnly, + writeOnly: writeOnly, + summary: summary, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'allOf'; + _allOf?.build(); + _$failedField = 'oneOf'; + _oneOf?.build(); + _$failedField = 'anyOf'; + _anyOf?.build(); + _$failedField = 'items'; + _items?.build(); + + _$failedField = 'properties'; + _properties?.build(); + _$failedField = 'additionalProperties'; + _additionalProperties?.build(); + + _$failedField = 'required'; + _required?.build(); + + _$failedField = 'enumValues'; + _enumValues?.build(); + _$failedField = 'discriminator'; + _discriminator?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiSchema', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiAdditionalProperties extends OpenApiAdditionalProperties { + @override + final bool? allow; + @override + final OpenApiComponentOrRef? schema; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiAdditionalProperties( + [void Function(OpenApiAdditionalPropertiesBuilder)? updates]) => + (new OpenApiAdditionalPropertiesBuilder()..update(updates))._build(); + + _$OpenApiAdditionalProperties._( + {this.allow, this.schema, this.ref, this.node, this.extensions}) + : super._(); + + @override + OpenApiAdditionalProperties rebuild( + void Function(OpenApiAdditionalPropertiesBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiAdditionalPropertiesBuilder toBuilder() => + new OpenApiAdditionalPropertiesBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiAdditionalProperties && + allow == other.allow && + schema == other.schema && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, allow.hashCode); + _$hash = $jc(_$hash, schema.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiAdditionalProperties') + ..add('allow', allow) + ..add('schema', schema) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiAdditionalPropertiesBuilder + implements + Builder { + _$OpenApiAdditionalProperties? _$v; + + bool? _allow; + bool? get allow => _$this._allow; + set allow(bool? allow) => _$this._allow = allow; + + OpenApiComponentOrRefBuilder? _schema; + OpenApiComponentOrRefBuilder get schema => + _$this._schema ??= new OpenApiComponentOrRefBuilder(); + set schema(OpenApiComponentOrRefBuilder? schema) => + _$this._schema = schema; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiAdditionalPropertiesBuilder(); + + OpenApiAdditionalPropertiesBuilder get _$this { + final $v = _$v; + if ($v != null) { + _allow = $v.allow; + _schema = $v.schema?.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiAdditionalProperties other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiAdditionalProperties; + } + + @override + void update(void Function(OpenApiAdditionalPropertiesBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiAdditionalProperties build() => _build(); + + _$OpenApiAdditionalProperties _build() { + _$OpenApiAdditionalProperties _$result; + try { + _$result = _$v ?? + new _$OpenApiAdditionalProperties._( + allow: allow, + schema: _schema?.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'schema'; + _schema?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiAdditionalProperties', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiDiscriminator extends OpenApiDiscriminator { + @override + final String propertyName; + @override + final BuiltMap? mapping; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiDiscriminator( + [void Function(OpenApiDiscriminatorBuilder)? updates]) => + (new OpenApiDiscriminatorBuilder()..update(updates))._build(); + + _$OpenApiDiscriminator._( + {required this.propertyName, + this.mapping, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + propertyName, r'OpenApiDiscriminator', 'propertyName'); + } + + @override + OpenApiDiscriminator rebuild( + void Function(OpenApiDiscriminatorBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiDiscriminatorBuilder toBuilder() => + new OpenApiDiscriminatorBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiDiscriminator && + propertyName == other.propertyName && + mapping == other.mapping && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, propertyName.hashCode); + _$hash = $jc(_$hash, mapping.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiDiscriminator') + ..add('propertyName', propertyName) + ..add('mapping', mapping) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiDiscriminatorBuilder + implements Builder { + _$OpenApiDiscriminator? _$v; + + String? _propertyName; + String? get propertyName => _$this._propertyName; + set propertyName(String? propertyName) => _$this._propertyName = propertyName; + + MapBuilder? _mapping; + MapBuilder get mapping => + _$this._mapping ??= new MapBuilder(); + set mapping(MapBuilder? mapping) => _$this._mapping = mapping; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiDiscriminatorBuilder(); + + OpenApiDiscriminatorBuilder get _$this { + final $v = _$v; + if ($v != null) { + _propertyName = $v.propertyName; + _mapping = $v.mapping?.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiDiscriminator other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiDiscriminator; + } + + @override + void update(void Function(OpenApiDiscriminatorBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiDiscriminator build() => _build(); + + _$OpenApiDiscriminator _build() { + _$OpenApiDiscriminator _$result; + try { + _$result = _$v ?? + new _$OpenApiDiscriminator._( + propertyName: BuiltValueNullFieldError.checkNotNull( + propertyName, r'OpenApiDiscriminator', 'propertyName'), + mapping: _mapping?.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'mapping'; + _mapping?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiDiscriminator', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiSecurityScheme extends OpenApiSecurityScheme { + @override + final OpenApiSecuritySchemeType type; + @override + final String? description; + @override + final String? name; + @override + final OpenApiParameterLocation? location; + @override + final String? scheme; + @override + final String? bearerFormat; + @override + final OpenApiOAuthFlows? flows; + @override + final String? openIdConnectUrl; + @override + final String? summary; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiSecurityScheme( + [void Function(OpenApiSecuritySchemeBuilder)? updates]) => + (new OpenApiSecuritySchemeBuilder()..update(updates))._build(); + + _$OpenApiSecurityScheme._( + {required this.type, + this.description, + this.name, + this.location, + this.scheme, + this.bearerFormat, + this.flows, + this.openIdConnectUrl, + this.summary, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + type, r'OpenApiSecurityScheme', 'type'); + } + + @override + OpenApiSecurityScheme rebuild( + void Function(OpenApiSecuritySchemeBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiSecuritySchemeBuilder toBuilder() => + new OpenApiSecuritySchemeBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiSecurityScheme && + type == other.type && + description == other.description && + name == other.name && + location == other.location && + scheme == other.scheme && + bearerFormat == other.bearerFormat && + flows == other.flows && + openIdConnectUrl == other.openIdConnectUrl && + summary == other.summary && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, type.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, location.hashCode); + _$hash = $jc(_$hash, scheme.hashCode); + _$hash = $jc(_$hash, bearerFormat.hashCode); + _$hash = $jc(_$hash, flows.hashCode); + _$hash = $jc(_$hash, openIdConnectUrl.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiSecurityScheme') + ..add('type', type) + ..add('description', description) + ..add('name', name) + ..add('location', location) + ..add('scheme', scheme) + ..add('bearerFormat', bearerFormat) + ..add('flows', flows) + ..add('openIdConnectUrl', openIdConnectUrl) + ..add('summary', summary) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiSecuritySchemeBuilder + implements + Builder, + OpenApiComponentBuilder { + _$OpenApiSecurityScheme? _$v; + + OpenApiSecuritySchemeType? _type; + OpenApiSecuritySchemeType? get type => _$this._type; + set type(covariant OpenApiSecuritySchemeType? type) => _$this._type = type; + + String? _description; + String? get description => _$this._description; + set description(covariant String? description) => + _$this._description = description; + + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; + + OpenApiParameterLocation? _location; + OpenApiParameterLocation? get location => _$this._location; + set location(covariant OpenApiParameterLocation? location) => + _$this._location = location; + + String? _scheme; + String? get scheme => _$this._scheme; + set scheme(covariant String? scheme) => _$this._scheme = scheme; + + String? _bearerFormat; + String? get bearerFormat => _$this._bearerFormat; + set bearerFormat(covariant String? bearerFormat) => + _$this._bearerFormat = bearerFormat; + + OpenApiOAuthFlowsBuilder? _flows; + OpenApiOAuthFlowsBuilder get flows => + _$this._flows ??= new OpenApiOAuthFlowsBuilder(); + set flows(covariant OpenApiOAuthFlowsBuilder? flows) => _$this._flows = flows; + + String? _openIdConnectUrl; + String? get openIdConnectUrl => _$this._openIdConnectUrl; + set openIdConnectUrl(covariant String? openIdConnectUrl) => + _$this._openIdConnectUrl = openIdConnectUrl; + + String? _summary; + String? get summary => _$this._summary; + set summary(covariant String? summary) => _$this._summary = summary; + + String? _ref; + String? get ref => _$this._ref; + set ref(covariant String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(covariant YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(covariant MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiSecuritySchemeBuilder(); + + OpenApiSecuritySchemeBuilder get _$this { + final $v = _$v; + if ($v != null) { + _type = $v.type; + _description = $v.description; + _name = $v.name; + _location = $v.location; + _scheme = $v.scheme; + _bearerFormat = $v.bearerFormat; + _flows = $v.flows?.toBuilder(); + _openIdConnectUrl = $v.openIdConnectUrl; + _summary = $v.summary; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant OpenApiSecurityScheme other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiSecurityScheme; + } + + @override + void update(void Function(OpenApiSecuritySchemeBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiSecurityScheme build() => _build(); + + _$OpenApiSecurityScheme _build() { + OpenApiSecurityScheme._validate(this); + _$OpenApiSecurityScheme _$result; + try { + _$result = _$v ?? + new _$OpenApiSecurityScheme._( + type: BuiltValueNullFieldError.checkNotNull( + type, r'OpenApiSecurityScheme', 'type'), + description: description, + name: name, + location: location, + scheme: scheme, + bearerFormat: bearerFormat, + flows: _flows?.build(), + openIdConnectUrl: openIdConnectUrl, + summary: summary, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'flows'; + _flows?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiSecurityScheme', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiOAuthFlows extends OpenApiOAuthFlows { + @override + final OpenApiOAuthFlow? implicit; + @override + final OpenApiOAuthFlow? password; + @override + final OpenApiOAuthFlow? clientCredentials; + @override + final OpenApiOAuthFlow? authorizationCode; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiOAuthFlows( + [void Function(OpenApiOAuthFlowsBuilder)? updates]) => + (new OpenApiOAuthFlowsBuilder()..update(updates))._build(); + + _$OpenApiOAuthFlows._( + {this.implicit, + this.password, + this.clientCredentials, + this.authorizationCode, + this.ref, + this.node, + this.extensions}) + : super._(); + + @override + OpenApiOAuthFlows rebuild(void Function(OpenApiOAuthFlowsBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiOAuthFlowsBuilder toBuilder() => + new OpenApiOAuthFlowsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiOAuthFlows && + implicit == other.implicit && + password == other.password && + clientCredentials == other.clientCredentials && + authorizationCode == other.authorizationCode && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, implicit.hashCode); + _$hash = $jc(_$hash, password.hashCode); + _$hash = $jc(_$hash, clientCredentials.hashCode); + _$hash = $jc(_$hash, authorizationCode.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiOAuthFlows') + ..add('implicit', implicit) + ..add('password', password) + ..add('clientCredentials', clientCredentials) + ..add('authorizationCode', authorizationCode) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiOAuthFlowsBuilder + implements Builder { + _$OpenApiOAuthFlows? _$v; + + OpenApiOAuthFlowBuilder? _implicit; + OpenApiOAuthFlowBuilder get implicit => + _$this._implicit ??= new OpenApiOAuthFlowBuilder(); + set implicit(OpenApiOAuthFlowBuilder? implicit) => + _$this._implicit = implicit; + + OpenApiOAuthFlowBuilder? _password; + OpenApiOAuthFlowBuilder get password => + _$this._password ??= new OpenApiOAuthFlowBuilder(); + set password(OpenApiOAuthFlowBuilder? password) => + _$this._password = password; + + OpenApiOAuthFlowBuilder? _clientCredentials; + OpenApiOAuthFlowBuilder get clientCredentials => + _$this._clientCredentials ??= new OpenApiOAuthFlowBuilder(); + set clientCredentials(OpenApiOAuthFlowBuilder? clientCredentials) => + _$this._clientCredentials = clientCredentials; + + OpenApiOAuthFlowBuilder? _authorizationCode; + OpenApiOAuthFlowBuilder get authorizationCode => + _$this._authorizationCode ??= new OpenApiOAuthFlowBuilder(); + set authorizationCode(OpenApiOAuthFlowBuilder? authorizationCode) => + _$this._authorizationCode = authorizationCode; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiOAuthFlowsBuilder(); + + OpenApiOAuthFlowsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _implicit = $v.implicit?.toBuilder(); + _password = $v.password?.toBuilder(); + _clientCredentials = $v.clientCredentials?.toBuilder(); + _authorizationCode = $v.authorizationCode?.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiOAuthFlows other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiOAuthFlows; + } + + @override + void update(void Function(OpenApiOAuthFlowsBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiOAuthFlows build() => _build(); + + _$OpenApiOAuthFlows _build() { + OpenApiOAuthFlows._validate(this); + _$OpenApiOAuthFlows _$result; + try { + _$result = _$v ?? + new _$OpenApiOAuthFlows._( + implicit: _implicit?.build(), + password: _password?.build(), + clientCredentials: _clientCredentials?.build(), + authorizationCode: _authorizationCode?.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'implicit'; + _implicit?.build(); + _$failedField = 'password'; + _password?.build(); + _$failedField = 'clientCredentials'; + _clientCredentials?.build(); + _$failedField = 'authorizationCode'; + _authorizationCode?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiOAuthFlows', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiOAuthFlow extends OpenApiOAuthFlow { + @override + final String? authorizationUrl; + @override + final String? tokenUrl; + @override + final String? refreshUrl; + @override + final BuiltMap scopes; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiOAuthFlow( + [void Function(OpenApiOAuthFlowBuilder)? updates]) => + (new OpenApiOAuthFlowBuilder()..update(updates))._build(); + + _$OpenApiOAuthFlow._( + {this.authorizationUrl, + this.tokenUrl, + this.refreshUrl, + required this.scopes, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + scopes, r'OpenApiOAuthFlow', 'scopes'); + } + + @override + OpenApiOAuthFlow rebuild(void Function(OpenApiOAuthFlowBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiOAuthFlowBuilder toBuilder() => + new OpenApiOAuthFlowBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiOAuthFlow && + authorizationUrl == other.authorizationUrl && + tokenUrl == other.tokenUrl && + refreshUrl == other.refreshUrl && + scopes == other.scopes && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, authorizationUrl.hashCode); + _$hash = $jc(_$hash, tokenUrl.hashCode); + _$hash = $jc(_$hash, refreshUrl.hashCode); + _$hash = $jc(_$hash, scopes.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiOAuthFlow') + ..add('authorizationUrl', authorizationUrl) + ..add('tokenUrl', tokenUrl) + ..add('refreshUrl', refreshUrl) + ..add('scopes', scopes) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiOAuthFlowBuilder + implements Builder { + _$OpenApiOAuthFlow? _$v; + + String? _authorizationUrl; + String? get authorizationUrl => _$this._authorizationUrl; + set authorizationUrl(String? authorizationUrl) => + _$this._authorizationUrl = authorizationUrl; + + String? _tokenUrl; + String? get tokenUrl => _$this._tokenUrl; + set tokenUrl(String? tokenUrl) => _$this._tokenUrl = tokenUrl; + + String? _refreshUrl; + String? get refreshUrl => _$this._refreshUrl; + set refreshUrl(String? refreshUrl) => _$this._refreshUrl = refreshUrl; + + MapBuilder? _scopes; + MapBuilder get scopes => + _$this._scopes ??= new MapBuilder(); + set scopes(MapBuilder? scopes) => _$this._scopes = scopes; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiOAuthFlowBuilder(); + + OpenApiOAuthFlowBuilder get _$this { + final $v = _$v; + if ($v != null) { + _authorizationUrl = $v.authorizationUrl; + _tokenUrl = $v.tokenUrl; + _refreshUrl = $v.refreshUrl; + _scopes = $v.scopes.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiOAuthFlow other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiOAuthFlow; + } + + @override + void update(void Function(OpenApiOAuthFlowBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiOAuthFlow build() => _build(); + + _$OpenApiOAuthFlow _build() { + _$OpenApiOAuthFlow _$result; + try { + _$result = _$v ?? + new _$OpenApiOAuthFlow._( + authorizationUrl: authorizationUrl, + tokenUrl: tokenUrl, + refreshUrl: refreshUrl, + scopes: scopes.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'scopes'; + scopes.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiOAuthFlow', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiSecurityRequirement extends OpenApiSecurityRequirement { + @override + final BuiltMap> schemes; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiSecurityRequirement( + [void Function(OpenApiSecurityRequirementBuilder)? updates]) => + (new OpenApiSecurityRequirementBuilder()..update(updates))._build(); + + _$OpenApiSecurityRequirement._( + {required this.schemes, this.ref, this.node, this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + schemes, r'OpenApiSecurityRequirement', 'schemes'); + } + + @override + OpenApiSecurityRequirement rebuild( + void Function(OpenApiSecurityRequirementBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiSecurityRequirementBuilder toBuilder() => + new OpenApiSecurityRequirementBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiSecurityRequirement && + schemes == other.schemes && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, schemes.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiSecurityRequirement') + ..add('schemes', schemes) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiSecurityRequirementBuilder + implements + Builder { + _$OpenApiSecurityRequirement? _$v; + + MapBuilder>? _schemes; + MapBuilder> get schemes => + _$this._schemes ??= new MapBuilder>(); + set schemes(MapBuilder>? schemes) => + _$this._schemes = schemes; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiSecurityRequirementBuilder(); + + OpenApiSecurityRequirementBuilder get _$this { + final $v = _$v; + if ($v != null) { + _schemes = $v.schemes.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiSecurityRequirement other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiSecurityRequirement; + } + + @override + void update(void Function(OpenApiSecurityRequirementBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiSecurityRequirement build() => _build(); + + _$OpenApiSecurityRequirement _build() { + _$OpenApiSecurityRequirement _$result; + try { + _$result = _$v ?? + new _$OpenApiSecurityRequirement._( + schemes: schemes.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'schemes'; + schemes.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiSecurityRequirement', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiTag extends OpenApiTag { + @override + final String name; + @override + final String? description; + @override + final OpenApiExternalDocs? externalDocs; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiTag([void Function(OpenApiTagBuilder)? updates]) => + (new OpenApiTagBuilder()..update(updates))._build(); + + _$OpenApiTag._( + {required this.name, + this.description, + this.externalDocs, + this.ref, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull(name, r'OpenApiTag', 'name'); + } + + @override + OpenApiTag rebuild(void Function(OpenApiTagBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiTagBuilder toBuilder() => new OpenApiTagBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiTag && + name == other.name && + description == other.description && + externalDocs == other.externalDocs && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, externalDocs.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiTag') + ..add('name', name) + ..add('description', description) + ..add('externalDocs', externalDocs) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiTagBuilder implements Builder { + _$OpenApiTag? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + OpenApiExternalDocsBuilder? _externalDocs; + OpenApiExternalDocsBuilder get externalDocs => + _$this._externalDocs ??= new OpenApiExternalDocsBuilder(); + set externalDocs(OpenApiExternalDocsBuilder? externalDocs) => + _$this._externalDocs = externalDocs; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiTagBuilder(); + + OpenApiTagBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _description = $v.description; + _externalDocs = $v.externalDocs?.toBuilder(); + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiTag other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiTag; + } + + @override + void update(void Function(OpenApiTagBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiTag build() => _build(); + + _$OpenApiTag _build() { + _$OpenApiTag _$result; + try { + _$result = _$v ?? + new _$OpenApiTag._( + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiTag', 'name'), + description: description, + externalDocs: _externalDocs?.build(), + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'externalDocs'; + _externalDocs?.build(); + + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiTag', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiContact extends OpenApiContact { + @override + final String? name; + @override + final String? url; + @override + final String? email; + @override + final String? ref; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiContact([void Function(OpenApiContactBuilder)? updates]) => + (new OpenApiContactBuilder()..update(updates))._build(); + + _$OpenApiContact._( + {this.name, this.url, this.email, this.ref, this.node, this.extensions}) + : super._(); + + @override + OpenApiContact rebuild(void Function(OpenApiContactBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiContactBuilder toBuilder() => + new OpenApiContactBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiContact && + name == other.name && + url == other.url && + email == other.email && + ref == other.ref && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, url.hashCode); + _$hash = $jc(_$hash, email.hashCode); + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiContact') + ..add('name', name) + ..add('url', url) + ..add('email', email) + ..add('ref', ref) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiContactBuilder + implements Builder { + _$OpenApiContact? _$v; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _url; + String? get url => _$this._url; + set url(String? url) => _$this._url = url; + + String? _email; + String? get email => _$this._email; + set email(String? email) => _$this._email = email; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiContactBuilder(); + + OpenApiContactBuilder get _$this { + final $v = _$v; + if ($v != null) { + _name = $v.name; + _url = $v.url; + _email = $v.email; + _ref = $v.ref; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiContact other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiContact; + } + + @override + void update(void Function(OpenApiContactBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiContact build() => _build(); + + _$OpenApiContact _build() { + _$OpenApiContact _$result; + try { + _$result = _$v ?? + new _$OpenApiContact._( + name: name, + url: url, + email: email, + ref: ref, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiContact', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiComponentOrRef> + extends OpenApiComponentOrRef { + @override + final String? ref; + @override + final T? component; + @override + final OpenApiReference? reference; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiComponentOrRef( + [void Function(OpenApiComponentOrRefBuilder)? updates]) => + (new OpenApiComponentOrRefBuilder()..update(updates))._build(); + + _$OpenApiComponentOrRef._( + {this.ref, this.component, this.reference, this.node, this.extensions}) + : super._() { + if (T == dynamic) { + throw new BuiltValueMissingGenericsError(r'OpenApiComponentOrRef', 'T'); + } + } + + @override + OpenApiComponentOrRef rebuild( + void Function(OpenApiComponentOrRefBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiComponentOrRefBuilder toBuilder() => + new OpenApiComponentOrRefBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiComponentOrRef && + ref == other.ref && + component == other.component && + reference == other.reference && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, component.hashCode); + _$hash = $jc(_$hash, reference.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiComponentOrRef') + ..add('ref', ref) + ..add('component', component) + ..add('reference', reference) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiComponentOrRefBuilder> + implements + Builder, OpenApiComponentOrRefBuilder> { + _$OpenApiComponentOrRef? _$v; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + T? _component; + T? get component => _$this._component; + set component(T? component) => _$this._component = component; + + OpenApiReference? _reference; + OpenApiReference? get reference => _$this._reference; + set reference(OpenApiReference? reference) => + _$this._reference = reference; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiComponentOrRefBuilder(); + + OpenApiComponentOrRefBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ref = $v.ref; + _component = $v.component; + _reference = $v.reference; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiComponentOrRef other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiComponentOrRef; + } + + @override + void update(void Function(OpenApiComponentOrRefBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiComponentOrRef build() => _build(); + + _$OpenApiComponentOrRef _build() { + OpenApiComponentOrRef._finalize(this); + _$OpenApiComponentOrRef _$result; + try { + _$result = _$v ?? + new _$OpenApiComponentOrRef._( + ref: ref, + component: component, + reference: reference, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiComponentOrRef', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiHeaderReference extends OpenApiHeaderReference { + @override + final String ref; + @override + final String name; + @override + final String? summary; + @override + final String? description; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiHeaderReference( + [void Function(OpenApiHeaderReferenceBuilder)? updates]) => + (new OpenApiHeaderReferenceBuilder()..update(updates))._build(); + + _$OpenApiHeaderReference._( + {required this.ref, + required this.name, + this.summary, + this.description, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiHeaderReference', 'ref'); + BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiHeaderReference', 'name'); + } + + @override + OpenApiHeaderReference rebuild( + void Function(OpenApiHeaderReferenceBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiHeaderReferenceBuilder toBuilder() => + new OpenApiHeaderReferenceBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiHeaderReference && + ref == other.ref && + name == other.name && + summary == other.summary && + description == other.description && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiHeaderReference') + ..add('ref', ref) + ..add('name', name) + ..add('summary', summary) + ..add('description', description) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiHeaderReferenceBuilder + implements Builder { + _$OpenApiHeaderReference? _$v; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _summary; + String? get summary => _$this._summary; + set summary(String? summary) => _$this._summary = summary; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiHeaderReferenceBuilder(); + + OpenApiHeaderReferenceBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ref = $v.ref; + _name = $v.name; + _summary = $v.summary; + _description = $v.description; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiHeaderReference other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiHeaderReference; + } + + @override + void update(void Function(OpenApiHeaderReferenceBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiHeaderReference build() => _build(); + + _$OpenApiHeaderReference _build() { + _$OpenApiHeaderReference _$result; + try { + _$result = _$v ?? + new _$OpenApiHeaderReference._( + ref: BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiHeaderReference', 'ref'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiHeaderReference', 'name'), + summary: summary, + description: description, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiHeaderReference', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiSchemaReference extends OpenApiSchemaReference { + @override + final String ref; + @override + final String name; + @override + final String? summary; + @override + final String? description; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiSchemaReference( + [void Function(OpenApiSchemaReferenceBuilder)? updates]) => + (new OpenApiSchemaReferenceBuilder()..update(updates))._build(); + + _$OpenApiSchemaReference._( + {required this.ref, + required this.name, + this.summary, + this.description, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiSchemaReference', 'ref'); + BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiSchemaReference', 'name'); + } + + @override + OpenApiSchemaReference rebuild( + void Function(OpenApiSchemaReferenceBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiSchemaReferenceBuilder toBuilder() => + new OpenApiSchemaReferenceBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiSchemaReference && + ref == other.ref && + name == other.name && + summary == other.summary && + description == other.description && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiSchemaReference') + ..add('ref', ref) + ..add('name', name) + ..add('summary', summary) + ..add('description', description) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiSchemaReferenceBuilder + implements Builder { + _$OpenApiSchemaReference? _$v; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _summary; + String? get summary => _$this._summary; + set summary(String? summary) => _$this._summary = summary; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiSchemaReferenceBuilder(); + + OpenApiSchemaReferenceBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ref = $v.ref; + _name = $v.name; + _summary = $v.summary; + _description = $v.description; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiSchemaReference other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiSchemaReference; + } + + @override + void update(void Function(OpenApiSchemaReferenceBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiSchemaReference build() => _build(); + + _$OpenApiSchemaReference _build() { + _$OpenApiSchemaReference _$result; + try { + _$result = _$v ?? + new _$OpenApiSchemaReference._( + ref: BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiSchemaReference', 'ref'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiSchemaReference', 'name'), + summary: summary, + description: description, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiSchemaReference', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiParameterReference extends OpenApiParameterReference { + @override + final String ref; + @override + final String name; + @override + final String? summary; + @override + final String? description; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiParameterReference( + [void Function(OpenApiParameterReferenceBuilder)? updates]) => + (new OpenApiParameterReferenceBuilder()..update(updates))._build(); + + _$OpenApiParameterReference._( + {required this.ref, + required this.name, + this.summary, + this.description, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiParameterReference', 'ref'); + BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiParameterReference', 'name'); + } + + @override + OpenApiParameterReference rebuild( + void Function(OpenApiParameterReferenceBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiParameterReferenceBuilder toBuilder() => + new OpenApiParameterReferenceBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiParameterReference && + ref == other.ref && + name == other.name && + summary == other.summary && + description == other.description && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiParameterReference') + ..add('ref', ref) + ..add('name', name) + ..add('summary', summary) + ..add('description', description) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiParameterReferenceBuilder + implements + Builder { + _$OpenApiParameterReference? _$v; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _summary; + String? get summary => _$this._summary; + set summary(String? summary) => _$this._summary = summary; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiParameterReferenceBuilder(); + + OpenApiParameterReferenceBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ref = $v.ref; + _name = $v.name; + _summary = $v.summary; + _description = $v.description; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiParameterReference other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiParameterReference; + } + + @override + void update(void Function(OpenApiParameterReferenceBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiParameterReference build() => _build(); + + _$OpenApiParameterReference _build() { + _$OpenApiParameterReference _$result; + try { + _$result = _$v ?? + new _$OpenApiParameterReference._( + ref: BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiParameterReference', 'ref'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiParameterReference', 'name'), + summary: summary, + description: description, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiParameterReference', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiRequestBodyReference extends OpenApiRequestBodyReference { + @override + final String ref; + @override + final String name; + @override + final String? summary; + @override + final String? description; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiRequestBodyReference( + [void Function(OpenApiRequestBodyReferenceBuilder)? updates]) => + (new OpenApiRequestBodyReferenceBuilder()..update(updates))._build(); + + _$OpenApiRequestBodyReference._( + {required this.ref, + required this.name, + this.summary, + this.description, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiRequestBodyReference', 'ref'); + BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiRequestBodyReference', 'name'); + } + + @override + OpenApiRequestBodyReference rebuild( + void Function(OpenApiRequestBodyReferenceBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiRequestBodyReferenceBuilder toBuilder() => + new OpenApiRequestBodyReferenceBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiRequestBodyReference && + ref == other.ref && + name == other.name && + summary == other.summary && + description == other.description && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiRequestBodyReference') + ..add('ref', ref) + ..add('name', name) + ..add('summary', summary) + ..add('description', description) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiRequestBodyReferenceBuilder + implements + Builder { + _$OpenApiRequestBodyReference? _$v; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _summary; + String? get summary => _$this._summary; + set summary(String? summary) => _$this._summary = summary; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiRequestBodyReferenceBuilder(); + + OpenApiRequestBodyReferenceBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ref = $v.ref; + _name = $v.name; + _summary = $v.summary; + _description = $v.description; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiRequestBodyReference other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiRequestBodyReference; + } + + @override + void update(void Function(OpenApiRequestBodyReferenceBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiRequestBodyReference build() => _build(); + + _$OpenApiRequestBodyReference _build() { + _$OpenApiRequestBodyReference _$result; + try { + _$result = _$v ?? + new _$OpenApiRequestBodyReference._( + ref: BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiRequestBodyReference', 'ref'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiRequestBodyReference', 'name'), + summary: summary, + description: description, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiRequestBodyReference', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiResponseReference extends OpenApiResponseReference { + @override + final String ref; + @override + final String name; + @override + final String? summary; + @override + final String? description; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiResponseReference( + [void Function(OpenApiResponseReferenceBuilder)? updates]) => + (new OpenApiResponseReferenceBuilder()..update(updates))._build(); + + _$OpenApiResponseReference._( + {required this.ref, + required this.name, + this.summary, + this.description, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiResponseReference', 'ref'); + BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiResponseReference', 'name'); + } + + @override + OpenApiResponseReference rebuild( + void Function(OpenApiResponseReferenceBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiResponseReferenceBuilder toBuilder() => + new OpenApiResponseReferenceBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiResponseReference && + ref == other.ref && + name == other.name && + summary == other.summary && + description == other.description && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiResponseReference') + ..add('ref', ref) + ..add('name', name) + ..add('summary', summary) + ..add('description', description) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiResponseReferenceBuilder + implements + Builder { + _$OpenApiResponseReference? _$v; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _summary; + String? get summary => _$this._summary; + set summary(String? summary) => _$this._summary = summary; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiResponseReferenceBuilder(); + + OpenApiResponseReferenceBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ref = $v.ref; + _name = $v.name; + _summary = $v.summary; + _description = $v.description; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiResponseReference other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiResponseReference; + } + + @override + void update(void Function(OpenApiResponseReferenceBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiResponseReference build() => _build(); + + _$OpenApiResponseReference _build() { + _$OpenApiResponseReference _$result; + try { + _$result = _$v ?? + new _$OpenApiResponseReference._( + ref: BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiResponseReference', 'ref'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiResponseReference', 'name'), + summary: summary, + description: description, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiResponseReference', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$OpenApiPathItemReference extends OpenApiPathItemReference { + @override + final String ref; + @override + final String name; + @override + final String? summary; + @override + final String? description; + @override + final YamlNode? node; + @override + final BuiltMap? extensions; + + factory _$OpenApiPathItemReference( + [void Function(OpenApiPathItemReferenceBuilder)? updates]) => + (new OpenApiPathItemReferenceBuilder()..update(updates))._build(); + + _$OpenApiPathItemReference._( + {required this.ref, + required this.name, + this.summary, + this.description, + this.node, + this.extensions}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiPathItemReference', 'ref'); + BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiPathItemReference', 'name'); + } + + @override + OpenApiPathItemReference rebuild( + void Function(OpenApiPathItemReferenceBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + OpenApiPathItemReferenceBuilder toBuilder() => + new OpenApiPathItemReferenceBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OpenApiPathItemReference && + ref == other.ref && + name == other.name && + summary == other.summary && + description == other.description && + node == other.node && + extensions == other.extensions; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ref.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, summary.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, node.hashCode); + _$hash = $jc(_$hash, extensions.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OpenApiPathItemReference') + ..add('ref', ref) + ..add('name', name) + ..add('summary', summary) + ..add('description', description) + ..add('node', node) + ..add('extensions', extensions)) + .toString(); + } +} + +class OpenApiPathItemReferenceBuilder + implements + Builder { + _$OpenApiPathItemReference? _$v; + + String? _ref; + String? get ref => _$this._ref; + set ref(String? ref) => _$this._ref = ref; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + String? _summary; + String? get summary => _$this._summary; + set summary(String? summary) => _$this._summary = summary; + + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; + + YamlNode? _node; + YamlNode? get node => _$this._node; + set node(YamlNode? node) => _$this._node = node; + + MapBuilder? _extensions; + MapBuilder get extensions => + _$this._extensions ??= new MapBuilder(); + set extensions(MapBuilder? extensions) => + _$this._extensions = extensions; + + OpenApiPathItemReferenceBuilder(); + + OpenApiPathItemReferenceBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ref = $v.ref; + _name = $v.name; + _summary = $v.summary; + _description = $v.description; + _node = $v.node; + _extensions = $v.extensions?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(OpenApiPathItemReference other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OpenApiPathItemReference; + } + + @override + void update(void Function(OpenApiPathItemReferenceBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OpenApiPathItemReference build() => _build(); + + _$OpenApiPathItemReference _build() { + _$OpenApiPathItemReference _$result; + try { + _$result = _$v ?? + new _$OpenApiPathItemReference._( + ref: BuiltValueNullFieldError.checkNotNull( + ref, r'OpenApiPathItemReference', 'ref'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'OpenApiPathItemReference', 'name'), + summary: summary, + description: description, + node: node, + extensions: _extensions?.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'extensions'; + _extensions?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'OpenApiPathItemReference', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/apps/cli/lib/src/openapi/ast/openapi_reference.dart b/apps/cli/lib/src/openapi/ast/openapi_reference.dart new file mode 100644 index 000000000..9d11f11a7 --- /dev/null +++ b/apps/cli/lib/src/openapi/ast/openapi_reference.dart @@ -0,0 +1,444 @@ +part of 'openapi_ast.dart'; + +abstract class OpenApiComponentOrRef> + implements + Built, OpenApiComponentOrRefBuilder>, + OpenApiNode { + factory OpenApiComponentOrRef.component({ + required T component, + String? ref, + }) { + return _$OpenApiComponentOrRef._( + ref: ref, + component: component, + ); + } + + factory OpenApiComponentOrRef.reference({ + required OpenApiReference reference, + String? ref, + YamlNode? node, + }) { + return _$OpenApiComponentOrRef._( + ref: ref, + node: node, + reference: reference, + ); + } + + factory OpenApiComponentOrRef.build([ + void Function(OpenApiComponentOrRefBuilder) updates, + ]) = _$OpenApiComponentOrRef; + + OpenApiComponentOrRef._(); + + @BuiltValueHook(finalizeBuilder: true) + static void + _finalize, R extends OpenApiReference>( + OpenApiComponentOrRefBuilder builder, + ) { + final setNeither = builder.component == null && builder.reference == null; + final setBoth = builder.component != null && builder.reference != null; + if (setNeither || setBoth) { + throw ArgumentError( + 'Exactly one of component or reference must be set', + ); + } + } + + @override + String? get ref; + + T? get component; + OpenApiReference? get reference; + + T resolve(OpenApiComponents components) { + if (component case final component?) { + return component; + } + final reference = this.reference!; + return reference.resolve(components).rebuild( + (b) { + if (reference.summary case final summary) { + b.summary = summary; + } + if (reference.description case final description) { + b.description = description; + } + }, + ); + } + + @override + R accept(OpenApiVisitor visitor) { + if (component case final component?) { + return component.accept(visitor); + } + return reference!.accept(visitor); + } + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) { + if (component case final component?) { + return component.acceptWithArg(visitor, arg); + } + return reference!.acceptWithArg(visitor, arg); + } +} + +sealed class OpenApiReference> + implements OpenApiNode { + /// The reference identifier. + /// + /// This MUST be in the form of a URI. + @override + String get ref; + String get name; + + /// A short summary which by default SHOULD override that of the referenced + /// component. + /// + /// If the referenced object-type does not allow a summary field, then this + /// field has no effect. + String? get summary; + + /// A description which by default SHOULD override that of the referenced + /// component. + /// + /// CommonMark syntax MAY be used for rich text representation. If the + /// referenced object-type does not allow a description field, then this + /// field has no effect. + String? get description; + + T resolve(OpenApiComponents components); +} + +abstract class OpenApiHeaderReference + implements + Built, + OpenApiReference { + factory OpenApiHeaderReference({ + required String ref, + required String name, + String? summary, + String? description, + YamlNode? node, + }) { + return _$OpenApiHeaderReference._( + ref: ref, + name: name, + summary: summary, + description: description, + node: node, + ); + } + + factory OpenApiHeaderReference.build([ + void Function(OpenApiHeaderReferenceBuilder) updates, + ]) = _$OpenApiHeaderReference; + + OpenApiHeaderReference._(); + + @override + OpenApiHeader resolve(OpenApiComponents components) { + return components.headers[name]!; + } + + @override + R accept(OpenApiVisitor visitor) => visitor.visitReference(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) { + return visitor.visitReference(this, arg); + } +} + +abstract class OpenApiSchemaReference + implements + Built, + OpenApiReference { + factory OpenApiSchemaReference({ + required String ref, + required String name, + String? summary, + String? description, + YamlNode? node, + }) { + return _$OpenApiSchemaReference._( + ref: ref, + name: name, + summary: summary, + description: description, + node: node, + ); + } + + factory OpenApiSchemaReference.build([ + void Function(OpenApiSchemaReferenceBuilder) updates, + ]) = _$OpenApiSchemaReference; + + OpenApiSchemaReference._(); + + @override + OpenApiSchema resolve(OpenApiComponents components) { + return components.schemas[name]!; + } + + @override + R accept(OpenApiVisitor visitor) => visitor.visitReference(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) { + return visitor.visitReference(this, arg); + } +} + +abstract class OpenApiParameterReference + implements + Built, + OpenApiReference { + factory OpenApiParameterReference({ + required String ref, + required String name, + String? summary, + String? description, + YamlNode? node, + }) { + return _$OpenApiParameterReference._( + ref: ref, + name: name, + summary: summary, + description: description, + node: node, + ); + } + + factory OpenApiParameterReference.build([ + void Function(OpenApiParameterReferenceBuilder) updates, + ]) = _$OpenApiParameterReference; + + OpenApiParameterReference._(); + + @override + OpenApiParameter resolve(OpenApiComponents components) { + return components.parameters[name]!; + } + + @override + R accept(OpenApiVisitor visitor) => visitor.visitReference(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) { + return visitor.visitReference(this, arg); + } +} + +abstract class OpenApiRequestBodyReference + implements + Built, + OpenApiReference { + factory OpenApiRequestBodyReference({ + required String ref, + required String name, + String? summary, + String? description, + YamlNode? node, + }) { + return _$OpenApiRequestBodyReference._( + ref: ref, + name: name, + summary: summary, + description: description, + node: node, + ); + } + + factory OpenApiRequestBodyReference.build([ + void Function(OpenApiRequestBodyReferenceBuilder) updates, + ]) = _$OpenApiRequestBodyReference; + + OpenApiRequestBodyReference._(); + + @override + OpenApiRequestBody resolve(OpenApiComponents components) { + return components.requestBodies[name]!; + } + + @override + R accept(OpenApiVisitor visitor) => visitor.visitReference(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) { + return visitor.visitReference(this, arg); + } +} + +abstract class OpenApiResponseReference + implements + Built, + OpenApiReference { + factory OpenApiResponseReference({ + required String ref, + required String name, + String? summary, + String? description, + YamlNode? node, + }) { + return _$OpenApiResponseReference._( + ref: ref, + name: name, + summary: summary, + description: description, + node: node, + ); + } + + factory OpenApiResponseReference.build([ + void Function(OpenApiResponseReferenceBuilder) updates, + ]) = _$OpenApiResponseReference; + + OpenApiResponseReference._(); + + @override + OpenApiResponse resolve(OpenApiComponents components) { + return components.responses[name]!; + } + + @override + R accept(OpenApiVisitor visitor) => visitor.visitReference(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) { + return visitor.visitReference(this, arg); + } +} + +abstract class OpenApiPathItemReference + implements + Built, + OpenApiReference { + factory OpenApiPathItemReference({ + required String ref, + required String name, + String? summary, + String? description, + YamlNode? node, + }) { + return _$OpenApiPathItemReference._( + ref: ref, + name: name, + summary: summary, + description: description, + node: node, + ); + } + + factory OpenApiPathItemReference.build([ + void Function(OpenApiPathItemReferenceBuilder) updates, + ]) = _$OpenApiPathItemReference; + + OpenApiPathItemReference._(); + + @override + OpenApiPathItem resolve(OpenApiComponents components) { + return components.paths[name]!; + } + + @override + R accept(OpenApiVisitor visitor) => visitor.visitReference(this); + + @override + R acceptWithArg(OpenApiVisitorWithArg visitor, A arg) { + return visitor.visitReference(this, arg); + } +} + +// abstract class OpenApiSecuritySchemeReference +// implements +// Built, +// OpenApiReference { +// factory OpenApiSecuritySchemeReference({ +// required String ref, +// required String name, +// String? summary, +// String? description, +// }) { +// return _$OpenApiSecuritySchemeReference._( +// ref: ref, +// name: name, +// summary: summary, +// description: description, +// ); +// } + +// factory OpenApiSecuritySchemeReference.build([ +// void Function(OpenApiSecuritySchemeReferenceBuilder) updates, +// ]) = _$OpenApiSecuritySchemeReference; + +// OpenApiSecuritySchemeReference._(); + +// @override +// OpenApiSecurityScheme resolve(OpenApiComponents components) { +// return components.securitySchemes[name]; +// } +// } + +// abstract class OpenApiLinkReference +// implements +// Built, +// OpenApiReference { +// factory OpenApiLinkReference({ +// required String ref, +// required String name, +// String? summary, +// String? description, +// }) { +// return _$OpenApiLinkReference._( +// ref: ref, +// name: name, +// summary: summary, +// description: description, +// ); +// } + +// factory OpenApiLinkReference.build([ +// void Function(OpenApiLinkReferenceBuilder) updates, +// ]) = _$OpenApiLinkReference; + +// OpenApiLinkReference._(); + +// @override +// OpenApiLink resolve(OpenApiComponents components) { +// return components.links[name]; +// } +// } + +// abstract class OpenApiCallbackReference +// implements +// Built, +// OpenApiReference { +// factory OpenApiCallbackReference({ +// required String ref, +// required String name, +// String? summary, +// String? description, +// }) { +// return _$OpenApiCallbackReference._( +// ref: ref, +// name: name, +// summary: summary, +// description: description, +// ); +// } + +// factory OpenApiCallbackReference.build([ +// void Function(OpenApiCallbackReferenceBuilder) updates, +// ]) = _$OpenApiCallbackReference; + +// OpenApiCallbackReference._(); + +// @override +// OpenApiCallback resolve(OpenApiComponents components) { +// return components.callbacks[name]; +// } +// } diff --git a/apps/cli/lib/src/openapi/ast/openapi_visitor.dart b/apps/cli/lib/src/openapi/ast/openapi_visitor.dart new file mode 100644 index 000000000..16d4fee5d --- /dev/null +++ b/apps/cli/lib/src/openapi/ast/openapi_visitor.dart @@ -0,0 +1,81 @@ +import 'package:celest_cli/src/openapi/ast/openapi_ast.dart'; + +abstract class OpenApiVisitor { + R visitDocument(OpenApiDocument document); + R visitInfo(OpenApiInfo info); + R visitServer(OpenApiServer server); + R visitServerVariable(OpenApiServerVariable serverVariable); + R visitPathItem(OpenApiPathItem pathItem); + R visitOperation(OpenApiOperation operation); + R visitParameter(OpenApiParameter parameter); + R visitMediaType(OpenApiMediaType mediaType); + R visitRequestBody(OpenApiRequestBody requestBody); + R visitEncoding(OpenApiEncoding encoding); + R visitResponse(OpenApiResponse response); + R visitHeader(OpenApiHeader header); + R visitComponents(OpenApiComponents components); + R visitComponent(OpenApiComponent component) => switch (component) { + OpenApiPathItem() => visitPathItem(component), + OpenApiParameter() => visitParameter(component), + OpenApiRequestBody() => visitRequestBody(component), + OpenApiResponse() => visitResponse(component), + OpenApiHeader() => visitHeader(component), + OpenApiSchema() => visitSchema(component), + OpenApiSecurityScheme() => visitSecurityScheme(component), + }; + R visitSchema(OpenApiSchema schema); + R visitSecurityRequirement(OpenApiSecurityRequirement securityRequirement); + R visitSecurityScheme(OpenApiSecurityScheme securityScheme); + R visitOAuthFlows(OpenApiOAuthFlows oauthFlows); + R visitOAuthFlow(OpenApiOAuthFlow oauthFlow); + R visitAdditionalProperties(OpenApiAdditionalProperties additionalProperties); + R visitDiscriminator(OpenApiDiscriminator discriminator); + R visitReference(OpenApiReference reference); + R visitExternalDocs(OpenApiExternalDocs externalDocs); + R visitTag(OpenApiTag tag); + R visitContact(OpenApiContact contact); + R visitLicense(OpenApiLicense license); +} + +abstract class OpenApiVisitorWithArg { + R visitDocument(OpenApiDocument document, A arg); + R visitInfo(OpenApiInfo info, A arg); + R visitServer(OpenApiServer server, A arg); + R visitServerVariable(OpenApiServerVariable serverVariable, A arg); + R visitPathItem(OpenApiPathItem pathItem, A arg); + R visitOperation(OpenApiOperation operation, A arg); + R visitParameter(OpenApiParameter parameter, A arg); + R visitMediaType(OpenApiMediaType mediaType, A arg); + R visitRequestBody(OpenApiRequestBody requestBody, A arg); + R visitEncoding(OpenApiEncoding encoding, A arg); + R visitResponse(OpenApiResponse response, A arg); + R visitHeader(OpenApiHeader header, A arg); + R visitComponents(OpenApiComponents components, A arg); + R visitComponent(OpenApiComponent component, A arg) => switch (component) { + OpenApiPathItem() => visitPathItem(component, arg), + OpenApiParameter() => visitParameter(component, arg), + OpenApiRequestBody() => visitRequestBody(component, arg), + OpenApiResponse() => visitResponse(component, arg), + OpenApiHeader() => visitHeader(component, arg), + OpenApiSchema() => visitSchema(component, arg), + OpenApiSecurityScheme() => visitSecurityScheme(component, arg), + }; + R visitSchema(OpenApiSchema schema, A arg); + R visitSecurityRequirement( + OpenApiSecurityRequirement securityRequirement, + A arg, + ); + R visitSecurityScheme(OpenApiSecurityScheme securityScheme, A arg); + R visitOAuthFlows(OpenApiOAuthFlows oauthFlows, A arg); + R visitOAuthFlow(OpenApiOAuthFlow oauthFlow, A arg); + R visitAdditionalProperties( + OpenApiAdditionalProperties additionalProperties, + A arg, + ); + R visitDiscriminator(OpenApiDiscriminator discriminator, A arg); + R visitReference(OpenApiReference reference, A arg); + R visitExternalDocs(OpenApiExternalDocs externalDocs, A arg); + R visitTag(OpenApiTag tag, A arg); + R visitContact(OpenApiContact contact, A arg); + R visitLicense(OpenApiLicense license, A arg); +} diff --git a/apps/cli/lib/src/openapi/loader/openapi_loader.dart b/apps/cli/lib/src/openapi/loader/openapi_loader.dart new file mode 100644 index 000000000..1876f9c9d --- /dev/null +++ b/apps/cli/lib/src/openapi/loader/openapi_loader.dart @@ -0,0 +1,60 @@ +import 'package:celest_cli/src/openapi/ast/openapi_ast.dart'; +import 'package:celest_cli/src/openapi/loader/openapi_v3_loader.dart'; +import 'package:pub_semver/pub_semver.dart'; +import 'package:yaml/yaml.dart'; + +final _versionPattern = RegExp(r'^(\d)\.(\d)(?:\.(\d))?$'); + +final class OpenApiDocumentLoader { + OpenApiDocumentLoader(); + + OpenApiDocument load({ + required String jsonOrYaml, + required Uri sourceUri, + }) { + return loadOpenApiDocument( + jsonOrYaml, + sourceUri: sourceUri, + ); + } +} + +OpenApiDocument loadOpenApiDocument( + String jsonOrYaml, { + required Uri sourceUri, +}) { + final document = loadYamlDocument(jsonOrYaml, sourceUrl: sourceUri); + final root = document.contents as YamlMap; + + final version = (root.nodes['swagger'] ?? root.nodes['openapi'])?.value; + if (version == null || version is! String) { + throw Exception('Could not detect OpenAPI version'); + } + + final semverMatch = _versionPattern.firstMatch(version); + final majorVersion = switch (semverMatch?.group(1)) { + final match? => int.tryParse(match), + null => null, + }; + final minorVersion = switch (semverMatch?.group(2)) { + final match? => int.tryParse(match), + null => 0, + }; + final patchVersion = switch (semverMatch?.group(3)) { + final match? => int.tryParse(match), + null => 0, + }; + if (majorVersion == null || minorVersion == null || patchVersion == null) { + throw Exception('Invalid OpenAPI version string: $version'); + } + final semver = Version( + majorVersion, + minorVersion, + patchVersion, + ); + return switch (majorVersion) { + 3 => OpenApiV3Loader(version: semver, rootNode: root).load(), + 2 => throw Exception('OpenAPI 2.0 is not supported'), + _ => throw Exception('Unknown OpenAPI version: $version'), + }; +} diff --git a/apps/cli/lib/src/openapi/loader/openapi_v3_loader.dart b/apps/cli/lib/src/openapi/loader/openapi_v3_loader.dart new file mode 100644 index 000000000..47f0cf7bf --- /dev/null +++ b/apps/cli/lib/src/openapi/loader/openapi_v3_loader.dart @@ -0,0 +1,1582 @@ +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:celest_cli/src/openapi/ast/openapi_ast.dart'; +import 'package:celest_cli/src/openapi/type/json_type.dart'; +import 'package:celest_cli/src/openapi/type/json_type_format.spec.dart'; +import 'package:collection/collection.dart'; +import 'package:http_parser/http_parser.dart'; +import 'package:pub_semver/pub_semver.dart'; +import 'package:yaml/yaml.dart'; + +final class OpenApiV3Loader { + OpenApiV3Loader({ + required this.version, + required this.rootNode, + }) : _document = OpenApiDocumentBuilder() + ..version = version; // TODO(dnys1): Source + + static final _extensionPattern = RegExp('^x-'); + static final _pathPattern = RegExp(r'^/'); + static final _statusCodePattern = RegExp(r'^[1-5][\dX]{2}$'); + static final _mediaTypePattern = RegExp(r'^[a-z]+/[a-z0-9\.\-\+]+$'); + + final OpenApiDocumentBuilder _document; + + late final OpenApiComponentsBuilder _components = _document.components; + late final OpenApiComponents components = _components.build(); + + final Version version; + final YamlMap rootNode; + + MapBuilder? _loadExtensions(YamlMap node) { + MapBuilder? extensions; + for (final entry in node.nodes.entries) { + final key = switch (entry.key) { + final String key => key, + YamlScalar(value: final String key) => key, + _ => null, + }; + if (key == null) { + continue; + } + if (_extensionPattern.hasMatch(key)) { + extensions ??= MapBuilder(); + extensions[key] = JsonObject(entry.value.value); + } + } + return extensions; + } + + OpenApiDocument load() { + rootNode.checkRequiredFields(['openapi', 'info', 'paths']); + rootNode.checkAllowedFields([ + 'components', + 'externalDocs', + 'info', + 'openapi', + 'paths', + 'security', + 'servers', + 'tags', + _extensionPattern, + ]); + + _document + ..ref = '#' + ..node = rootNode + ..extensions = _loadExtensions(rootNode); + + _loadInfo(); + _loadServers(); + _loadComponents(); + _loadPaths(); + _loadSecurityRequirements(); + _loadExternalDocs(); + _loadTags(); + + return _document.build(); + } + + OpenApiReference + _ref, R extends OpenApiReference>( + YamlMap refNode, + ) { + final map = Map.fromEntries(refNode.yamlNodes); + final ref = map[r'$ref']?.getScalar(); + if (ref == null) { + throw Exception('OpenAPI component reference is missing "$refNode"'); + } + final summary = map['summary']?.getScalar(); + final description = map['description']?.getScalar(); + switch (ref.split('/')) { + case ['#', 'components', final type, final name]: + return switch (type) { + 'schemas' => OpenApiSchemaReference( + ref: ref, + name: name, + summary: summary, + description: description, + node: refNode, + ), + 'responses' => OpenApiResponseReference( + ref: ref, + name: name, + summary: summary, + description: description, + node: refNode, + ), + 'parameters' => OpenApiParameterReference( + ref: ref, + name: name, + summary: summary, + description: description, + node: refNode, + ), + 'requestBodies' => OpenApiRequestBodyReference( + ref: ref, + name: name, + summary: summary, + description: description, + node: refNode, + ), + 'headers' => OpenApiHeaderReference( + ref: ref, + name: name, + summary: summary, + description: description, + node: refNode, + ), + _ => throw Exception('Invalid component type: $type'), + } as R; + default: + throw Exception('Invalid component reference: $refNode'); + } + } + + void _loadInfo() { + final infoNode = rootNode.nodes['info'].getAs(); + if (infoNode == null) { + throw Exception('OpenAPI document is missing required key "info"'); + } + + infoNode.checkRequiredFields(['title', 'version']); + infoNode.checkAllowedFields([ + 'contact', + 'description', + 'license', + 'summary', + 'termsOfService', + 'title', + 'version', + _extensionPattern, + ]); + + _document.info + ..title = infoNode.nodes['title']?.value as String? + ..description = infoNode.nodes['description']?.value as String? + ..apiVersion = infoNode.nodes['version']?.value as String? + ..ref = '#/info' + ..node = infoNode + ..extensions = _loadExtensions(infoNode); + + final contactNode = infoNode.nodes['contact']?.getAs(); + if (contactNode != null) { + _document.info.contact = _loadContact(contactNode); + } + + final licenseNode = infoNode.nodes['license']?.getAs(); + if (licenseNode != null) { + _document.info.license = _loadLicense(licenseNode); + } + } + + OpenApiContactBuilder _loadContact(YamlMap contactNode) { + return OpenApiContactBuilder() + ..ref = '#/info/contact' + ..node = contactNode + ..extensions = _loadExtensions(contactNode) + ..name = contactNode.nodes['name']?.value as String? + ..url = contactNode.nodes['url']?.value as String? + ..email = contactNode.nodes['email']?.value as String?; + } + + OpenApiLicenseBuilder _loadLicense(YamlMap licenseNode) { + return OpenApiLicenseBuilder() + ..ref = '#/info/license' + ..node = licenseNode + ..extensions = _loadExtensions(licenseNode) + ..name = licenseNode.nodes['name']?.value as String? + ..url = licenseNode.nodes['url']?.value as String? + ..identifier = licenseNode.nodes['identifier']?.value as String?; + } + + void _loadServers() { + final serversNode = rootNode.nodes['servers'].getAs(); + if (serversNode == null) { + return; + } + + for (final serverNode in serversNode.nodes) { + if (serverNode is! YamlMap) { + throw Exception('OpenAPI server is not a map'); + } + + final server = _loadServer( + serverNode, + ref: '#/servers/${_document.servers.length}', + ); + _document.servers.add(server.build()); + } + } + + void _loadPaths() { + final pathsNode = rootNode.nodes['paths'].getAs(); + if (pathsNode == null) { + throw Exception('OpenAPI document is missing required key "paths"'); + } + + pathsNode.checkAllowedFields([ + _pathPattern, + _extensionPattern, + ]); + + for (final entry in pathsNode.yamlNodes) { + final pathNode = entry.value.getAs(); + if (pathNode == null) { + throw Exception('OpenAPI path is not a map'); + } + + final path = _loadPathItemOrRef(pathNode, ref: '#/paths/${entry.key}'); + _document.paths[entry.key] = path; + } + } + + void _loadComponents() { + // Only load schemas, responses, parameters, requestBodies, headers, and paths + final componentsNode = rootNode.nodes['components'].getAs(); + if (componentsNode == null) { + return; + } + + componentsNode.checkAllowedFields([ + 'schemas', + 'responses', + 'parameters', + 'examples', + 'requestBodies', + 'headers', + 'securitySchemes', + 'links', + 'callbacks', + 'pathItems', + _extensionPattern, + ]); + + _components + ..ref = '#/components' + ..node = componentsNode + ..extensions = _loadExtensions(componentsNode); + + final schemasNode = componentsNode.nodes['schemas']?.getAs(); + if (schemasNode != null) { + for (final entry in schemasNode.yamlNodes) { + final schemaNode = entry.value.getAs(); + if (schemaNode == null) { + throw Exception('OpenAPI schema is not a map'); + } + final schemaName = entry.key; + final schema = _loadSchema( + schemaNode, + ref: '#/components/schemas/$schemaName', + ); + _components.schemas[schemaName] = schema; + } + } + + final responsesNode = componentsNode.nodes['responses']?.getAs(); + if (responsesNode != null) { + for (final entry in responsesNode.yamlNodes) { + final responseNode = entry.value.getAs(); + if (responseNode == null) { + throw Exception('OpenAPI response is not a map'); + } + + final responseName = entry.key; + final response = _loadResponse( + responseNode, + ref: '#/components/responses/$responseName', + ); + _components.responses[responseName] = response; + } + } + + final parametersNode = componentsNode.nodes['parameters']?.getAs(); + if (parametersNode != null) { + for (final entry in parametersNode.yamlNodes) { + final parameterNode = entry.value.getAs(); + if (parameterNode == null) { + throw Exception('OpenAPI parameter is not a map'); + } + + final parameterName = entry.key; + final parameter = _loadParameter( + parameterNode, + ref: '#/components/parameters/$parameterName', + ); + _components.parameters[parameterName] = parameter; + } + } + + final requestBodiesNode = + componentsNode.nodes['requestBodies']?.getAs(); + if (requestBodiesNode != null) { + for (final entry in requestBodiesNode.yamlNodes) { + final requestBodyNode = entry.value.getAs(); + if (requestBodyNode == null) { + throw Exception('OpenAPI request body is not a map'); + } + + final requestBodyName = entry.key; + final requestBody = _loadRequestBody( + requestBodyNode, + ref: '#/components/requestBodies/$requestBodyName', + ); + _components.requestBodies[requestBodyName] = requestBody; + } + } + + final headersNode = componentsNode.nodes['headers']?.getAs(); + if (headersNode != null) { + for (final entry in headersNode.yamlNodes) { + final headerNode = entry.value.getAs(); + if (headerNode == null) { + throw Exception('OpenAPI header is not a map'); + } + + final headerName = entry.key; + final header = _loadHeader( + headerNode, + ref: '#/components/headers/$headerName', + ); + _components.headers[headerName] = header; + } + } + + final pathsNode = componentsNode.nodes['paths']?.getAs(); + if (pathsNode != null) { + for (final entry in pathsNode.yamlNodes) { + final pathNode = entry.value.getAs(); + if (pathNode == null) { + throw Exception('OpenAPI path is not a map'); + } + + final pathName = entry.key; + final path = _loadPathItem( + pathNode, + ref: '#/components/paths/$pathName', + ); + _components.paths[pathName] = path; + } + } + + final securitySchemesNode = + componentsNode.nodes['securitySchemes']?.getAs(); + if (securitySchemesNode != null) { + for (final entry in securitySchemesNode.yamlNodes) { + final securitySchemeNode = entry.value.getAs(); + if (securitySchemeNode == null) { + throw Exception('OpenAPI security scheme is not a map'); + } + + final securitySchemeName = entry.key; + final securityScheme = _loadSecurityScheme( + securitySchemeNode, + ref: '#/components/securitySchemes/$securitySchemeName', + ); + _components.securitySchemes[securitySchemeName] = securityScheme; + } + } + } + + void _loadSecurityRequirements() { + final securityRequirementsNode = + rootNode.nodes['security'].getAs(); + if (securityRequirementsNode == null) { + return; + } + + for (final (index, entry) in securityRequirementsNode.nodes.indexed) { + final requirementNode = entry.getAs(); + if (requirementNode == null) { + throw Exception('OpenAPI security requirement is not a map'); + } + + final requirement = OpenApiSecurityRequirementBuilder() + ..ref = '#/security/$index' + ..node = entry + ..extensions = _loadExtensions(requirementNode); + + for (final entry in requirementNode.yamlNodes) { + requirement.schemes[entry.key] = entry.value + .getAs()! + .nodes + .map((node) => node.getScalar()) + .toBuiltList(); + } + + _document.securityRequirements.add(requirement.build()); + } + } + + void _loadExternalDocs() { + final externalDocsNode = rootNode.nodes['externalDocs'].getAs(); + if (externalDocsNode == null) { + return; + } + + externalDocsNode.checkAllowedFields([ + 'description', + 'url', + _extensionPattern, + ]); + + _document.externalDocs = OpenApiExternalDocsBuilder() + ..ref = '#/externalDocs' + ..node = externalDocsNode + ..extensions = _loadExtensions(externalDocsNode); + + _document.externalDocs.url = + externalDocsNode.nodes['url']?.value as String?; + _document.externalDocs.description = + externalDocsNode.nodes['description']?.value as String?; + } + + void _loadTags() { + final tagsNode = rootNode.nodes['tags'].getAs(); + if (tagsNode == null) { + return; + } + + for (final (index, tagNode) in tagsNode.nodes.indexed) { + if (tagNode is! YamlMap) { + throw Exception('OpenAPI tag is not a map'); + } + + final tag = OpenApiTagBuilder() + ..ref = '#/tags/$index' + ..node = tagNode + ..extensions = _loadExtensions(tagNode); + + tag.name = tagNode.nodes['name']?.value as String?; + tag.description = tagNode.nodes['description']?.value as String?; + + final externalDocsNode = tagNode.nodes['externalDocs'].getAs(); + if (externalDocsNode != null) { + tag.externalDocs = OpenApiExternalDocsBuilder() + ..ref = '#/tags/$index/externalDocs' + ..node = externalDocsNode + ..extensions = _loadExtensions(externalDocsNode); + tag.externalDocs.url = externalDocsNode.nodes['url']?.value as String?; + tag.externalDocs.description = + externalDocsNode.nodes['description']?.value as String?; + } + + _document.tags.add(tag.build()); + } + } + + OpenApiServerBuilder _loadServer( + YamlMap serverNode, { + required String ref, + }) { + serverNode.checkRequiredFields(['url']); + serverNode.checkAllowedFields([ + 'description', + 'url', + 'variables', + _extensionPattern, + ]); + + final server = OpenApiServerBuilder() + ..ref = ref + ..node = serverNode + ..extensions = _loadExtensions(serverNode); + server.url = serverNode.nodes['url']?.value as String?; + server.description = serverNode.nodes['description']?.value as String?; + + final variablesNode = serverNode.nodes['variables']; + if (variablesNode != null && variablesNode is YamlMap) { + for (final entry in variablesNode.yamlNodes) { + final variableNode = entry.value; + if (variableNode is! YamlMap) { + throw Exception('OpenAPI server variable is not a map'); + } + + variableNode.checkRequiredFields(['default']); + variableNode.checkAllowedFields([ + 'default', + 'description', + 'enum', + 'x-example', + _extensionPattern, + ]); + + final variable = OpenApiServerVariableBuilder(); + variable + ..defaultValue = variableNode.nodes['default']?.value as String? + ..description = variableNode.nodes['description']?.value as String? + ..extensions = _loadExtensions(variableNode); + + final enumNode = variableNode.nodes['enum'].getAs(); + if (enumNode != null) { + // The array MUST NOT be empty. + if (enumNode.isEmpty) { + throw Exception('OpenAPI server variable enum is empty'); + } + for (final enumValueNode in enumNode.nodes) { + if (enumValueNode is! YamlScalar) { + throw Exception( + 'OpenAPI server variable enum value is not a scalar', + ); + } + variable.enumValues.add(enumValueNode.value as String); + } + } + + server.variables[entry.key] = variable.build(); + } + } + + return server; + } + + OpenApiComponentOrRef _loadPathItemOrRef( + YamlMap pathItemNode, { + required String ref, + }) { + if (pathItemNode.nodes.containsKey(r'$ref')) { + return OpenApiComponentOrRef.reference( + ref: ref, + node: pathItemNode, + reference: + _ref(pathItemNode), + ); + } + return OpenApiComponentOrRef.component( + ref: ref, + component: _loadPathItem( + pathItemNode, + ref: ref, + ), + ); + } + + OpenApiPathItem _loadPathItem( + YamlMap pathItemNode, { + required String ref, + }) { + if (pathItemNode.nodes.containsKey(r'$ref')) { + throw Exception('OpenAPI path reference is not allowed'); + } + + pathItemNode.checkAllowedFields([ + 'delete', + 'get', + 'head', + 'options', + 'parameters', + 'patch', + 'post', + 'put', + 'summary', + _extensionPattern, + ]); + + final path = OpenApiPathItemBuilder(); + path + ..ref = ref + ..node = pathItemNode + ..summary = pathItemNode.nodes['summary']?.value as String? + ..extensions = _loadExtensions(pathItemNode); + + for (final method in OpenApiOperationType.values) { + final operationNode = pathItemNode.nodes[method.name].getAs(); + if (operationNode == null) { + continue; + } + + operationNode.checkAllowedFields([ + 'callbacks', + 'deprecated', + 'description', + 'externalDocs', + 'operationId', + 'parameters', + 'requestBody', + 'responses', + 'security', + 'servers', + 'summary', + 'tags', + _extensionPattern, + ]); + + final operation = OpenApiOperationBuilder() + ..type = method + ..deprecated = operationNode.nodes['deprecated']?.value as bool? + ..description = operationNode.nodes['description']?.value as String? + ..operationId = operationNode.nodes['operationId']?.value as String? + ..summary = operationNode.nodes['summary']?.value as String? + ..extensions = _loadExtensions(operationNode); + + final tagsNode = operationNode.nodes['tags'].getAs(); + if (tagsNode != null) { + for (final tag in tagsNode.nodes) { + operation.tags.add(tag.getScalar()); + } + } + + final requestBodyNode = + operationNode.nodes['requestBody']?.getAs(); + if (requestBodyNode != null) { + final requestBody = _loadRequestBodyOrRef( + requestBodyNode, + ref: '$ref/${method.name}/requestBody', + ); + operation.requestBody.replace(requestBody); + } + + final responsesNode = operationNode.nodes['responses'].getAs(); + if (responsesNode != null) { + responsesNode.checkAllowedFields([ + 'default', + _statusCodePattern, + _extensionPattern, + ]); + + for (final entry in responsesNode.yamlNodes) { + final responseNode = entry.value.getAs(); + if (responseNode == null) { + throw Exception('OpenAPI response is not a map'); + } + + final response = _loadResponseOrRef( + responseNode, + ref: '$ref/${method.name}/responses/${entry.key}', + ); + if (entry.key == 'default') { + operation.defaultResponse.replace(response); + continue; + } + + final statusCode = StatusCodeOrRange.tryParse(entry.key); + if (statusCode == null) { + throw Exception( + 'Invalid OpenAPI status code or range: ${entry.key}', + ); + } + operation.responses[statusCode] = response; + } + } + + final parametersNode = + operationNode.nodes['parameters'].getAs(); + if (parametersNode != null) { + for (final (parameterIndex, parameterNode) + in parametersNode.nodes.indexed) { + if (parameterNode is! YamlMap) { + throw Exception('OpenAPI parameter is not a map'); + } + + final parameter = _loadParameterOrRef( + parameterNode, + ref: '$ref/${method.name}/parameters/$parameterIndex', + ); + operation.parameters.add(parameter); + } + } + + final serversNode = operationNode.nodes['servers'].getAs(); + if (serversNode != null) { + for (final (serverIndex, serverNode) in serversNode.nodes.indexed) { + if (serverNode is! YamlMap) { + throw Exception('OpenAPI server is not a map'); + } + + final server = _loadServer( + serverNode, + ref: '$ref/${method.name}/servers/$serverIndex', + ); + operation.servers.add(server.build()); + } + } + + path.operations[method] = operation.build(); + } + + return path.build(); + } + + OpenApiComponentOrRef _loadSchemaOrRef( + YamlMap schemaNode, { + required String ref, + }) { + if (schemaNode.nodes.containsKey(r'$ref')) { + return OpenApiComponentOrRef.reference( + ref: ref, + node: schemaNode, + reference: _ref(schemaNode), + ); + } + return OpenApiComponentOrRef.component( + ref: ref, + component: _loadSchema(schemaNode, ref: ref), + ); + } + + OpenApiSchema _loadSchema( + YamlMap schemaNode, { + required String ref, + }) { + if (schemaNode.nodes.containsKey(r'$ref')) { + throw Exception('OpenAPI schema reference is not allowed'); + } + schemaNode.checkAllowedFields([ + 'allOf', + 'anyOf', + 'const', + 'contentEncoding', // TODO(dnys1): Implement + 'contentMediaType', // Implement + 'contentSchema', // Implement + 'default', + 'deprecated', + 'description', + 'discriminator', + 'enum', + 'example', + 'exclusiveMaximum', + 'exclusiveMinimum', + 'externalDocs', + 'format', + 'items', + 'maximum', + 'maxItems', + 'maxLength', + 'maxProperties', + 'minimum', + 'minItems', + 'minLength', + 'minProperties', + 'multipleOf', + // TODO(dnys1): Needed? + // 'not', + 'nullable', + 'oneOf', + 'pattern', + 'properties', + 'additionalProperties', + 'readOnly', + 'required', + 'title', + 'type', + 'uniqueItems', + 'writeOnly', + _extensionPattern, + ]); + + final yamlNodes = Map.fromEntries(schemaNode.yamlNodes); + + OpenApiComponentOrRef? schema(String key) { + return yamlNodes[key]?.getAs()?.let( + (node) => _loadSchemaOrRef(node, ref: '$ref/$key'), + ); + } + + Map>? schemaMap(String key) { + return yamlNodes[key]?.getAs()?.nodes.map( + (itemKey, node) => MapEntry( + switch (itemKey) { + final String key => key, + YamlScalar(value: final String key) => key, + _ => throw Exception('OpenAPI schema key is not a string'), + }, + _loadSchemaOrRef( + node.getAs()!, + ref: '$ref/$key/$itemKey', + ), + ), + ); + } + + Iterable>? schemaList(String key) { + return yamlNodes[key]?.getAs()?.nodes.mapIndexed( + (index, node) => _loadSchemaOrRef( + node.getAs()!, + ref: '$ref/$key/$index', + ), + ); + } + + Iterable? scalarList(String key) => + schemaNode.nodes[key]?.getAs()?.nodes.mapIndexed( + (index, node) => node.getScalar(ref: '$ref/$key/$index'), + ); + + T? scalar(String key) => switch (schemaNode.nodes[key]) { + final YamlScalar scalar => scalar.getScalar(ref: '$ref/$key'), + final YamlList list => list.value as T, + final node => node as T?, + }; + + OpenApiAdditionalProperties? additionalProperties; + if (yamlNodes['additionalProperties'] + case final additionalPropertiesNode?) { + switch (additionalPropertiesNode) { + case YamlScalar(value: final bool allow): + additionalProperties = OpenApiAdditionalProperties(allow: allow); + case YamlMap(): + additionalProperties = OpenApiAdditionalProperties( + schema: _loadSchemaOrRef( + additionalPropertiesNode, + ref: '$ref/additionalProperties', + ), + ); + } + } + + Map? extensions; + for (final MapEntry(:key, value: valueNode) in yamlNodes.entries) { + if (!_extensionPattern.hasMatch(key)) { + continue; + } + extensions ??= {}; + extensions[key] = valueNode.value; + } + + final type = switch (yamlNodes['type']) { + final YamlScalar scalar => ItemValue( + JsonType.fromYaml(scalar.value as String), + ), + final YamlList list => ItemList( + list.nodes + .map((it) => it.getScalar()) + .map(JsonType.fromYaml) + .toList(), + ), + null => null, + _ => throw Exception('OpenAPI schema type is not a string or list'), + }; + + final discriminatorNode = yamlNodes['discriminator']?.getAs(); + OpenApiDiscriminator? discriminator; + if (discriminatorNode != null) { + discriminatorNode.checkRequiredFields([ + 'propertyName', + ]); + discriminatorNode.checkAllowedFields([ + 'mapping', + 'propertyName', + _extensionPattern, + ]); + final discriminatorMap = Map.fromEntries(discriminatorNode.yamlNodes); + final mappingNode = discriminatorMap['mapping']?.getAs(); + discriminator = OpenApiDiscriminator( + ref: '$ref/discriminator', + node: discriminatorNode, + propertyName: discriminatorMap['propertyName'].getScalar(), + mapping: switch (mappingNode) { + final node? => { + for (final MapEntry(:key, :value) in node.yamlNodes) + key: value.getScalar(), + }, + _ => null, + }, + ); + } + + // TODO(dnys1): Give `const` it's own field. + final enumValues = scalarList('enum') ?? + scalar('const')?.let((it) => [it]); + + return OpenApiSchema( + ref: ref, + name: + ref.startsWith('#/components/schemas/') ? ref.split('/').last : null, + node: schemaNode, + type: type, + allOf: schemaList('allOf'), + anyOf: schemaList('anyOf'), + defaultValue: scalar('default'), + deprecated: scalar('deprecated'), + description: scalar('description'), + enumValues: enumValues, + exclusiveMaximum: scalar('exclusiveMaximum'), + exclusiveMinimum: scalar('exclusiveMinimum'), + format: scalar('format')?.let(JsonTypeFormat.new), + items: schema('items'), + maximum: scalar('maximum'), + maxItems: scalar('maxItems'), + maxLength: scalar('maxLength'), + maxProperties: scalar('maxProperties'), + minimum: scalar('minimum'), + minItems: scalar('minItems'), + minLength: scalar('minLength'), + minProperties: scalar('minProperties'), + multipleOf: scalar('multipleOf'), + nullable: scalar('nullable'), + oneOf: schemaList('oneOf'), + pattern: scalar('pattern'), + properties: schemaMap('properties'), + additionalProperties: additionalProperties, + readOnly: scalar('readOnly'), + required: scalarList('required'), + title: scalar('title'), + uniqueItems: scalar('uniqueItems'), + writeOnly: scalar('writeOnly'), + discriminator: discriminator, + example: scalar('example'), + extensions: extensions, + ); + } + + OpenApiComponentOrRef _loadResponseOrRef( + YamlMap responseNode, { + required String ref, + }) { + if (responseNode.nodes.containsKey(r'$ref')) { + return OpenApiComponentOrRef.reference( + ref: ref, + node: responseNode, + reference: + _ref(responseNode), + ); + } + return OpenApiComponentOrRef.component( + ref: ref, + component: _loadResponse(responseNode, ref: ref), + ); + } + + OpenApiResponse _loadResponse( + YamlMap responseNode, { + required String ref, + }) { + if (responseNode.nodes.containsKey(r'$ref')) { + throw Exception('OpenAPI response reference is not allowed'); + } + + responseNode.checkAllowedFields([ + 'content', + 'description', + 'headers', + 'links', + 'content', + _extensionPattern, + ]); + + final response = OpenApiResponseBuilder(); + response + ..ref = ref + ..node = responseNode + ..description = responseNode.nodes['description']?.value as String? + ..extensions = _loadExtensions(responseNode); + + final contentNode = responseNode.nodes['content'].getAs(); + if (contentNode != null) { + contentNode.checkAllowedFields([ + _mediaTypePattern, + _extensionPattern, + ]); + response.content; // Create the map builder -- null vs. {} + + for (final entry in contentNode.yamlNodes) { + final mediaTypeNode = entry.value.getAs(); + if (mediaTypeNode == null) { + throw Exception('OpenAPI media type is not a map'); + } + + final mediaType = _loadMediaType( + mediaTypeNode, + ref: '$ref/content/${entry.key}', + ); + response.content[MediaType.parse(entry.key)] = mediaType.build(); + } + } + + final headersNode = responseNode.nodes['headers'].getAs(); + if (headersNode != null) { + response.headers; // Create the map builder -- null vs. {} + + for (final entry in headersNode.yamlNodes) { + final headerNode = entry.value.getAs(); + if (headerNode == null) { + throw Exception('OpenAPI header is not a map'); + } + + final header = _loadHeaderOrRef( + headerNode, + ref: '$ref/headers/${entry.key}', + ); + response.headers[entry.key] = header; + } + } + + return response.build(); + } + + OpenApiComponentOrRef _loadParameterOrRef( + YamlMap parameterNode, { + required String ref, + }) { + if (parameterNode.nodes.containsKey(r'$ref')) { + return OpenApiComponentOrRef.reference( + ref: ref, + node: parameterNode, + reference: _ref( + parameterNode, + ), + ); + } + return OpenApiComponentOrRef.component( + ref: ref, + component: _loadParameter(parameterNode, ref: ref), + ); + } + + OpenApiParameter _loadParameter( + YamlMap parameterNode, { + required String ref, + }) { + if (parameterNode.nodes.containsKey(r'$ref')) { + throw Exception('OpenAPI parameter reference is not allowed'); + } + + parameterNode.checkRequiredFields(['in', 'name']); + parameterNode.checkAllowedFields([ + 'allowEmptyValue', + 'allowReserved', + 'content', + 'deprecated', + 'description', + 'example', + 'examples', + 'explode', + 'in', + 'name', + 'required', + 'schema', + 'style', + _extensionPattern, + ]); + + final parameter = OpenApiParameterBuilder() + ..ref = ref + ..node = parameterNode; + final location = parameterNode.nodes['in'].getScalar(); + parameter.location = OpenApiParameterLocation.valueOf(location); + parameter.name = parameterNode.nodes['name'].getScalar(); + parameter.description = parameterNode.nodes['description']?.getScalar(); + parameter.required = parameterNode.nodes['required']?.getScalar(); + parameter.extensions = _loadExtensions(parameterNode); + + final schemaNode = parameterNode.nodes['schema'].getAs(); + if (schemaNode != null) { + final schema = _loadSchemaOrRef( + schemaNode, + ref: '$ref/schema', + ); + parameter.schema.replace(schema); + } + + final contentNode = parameterNode.nodes['content'].getAs(); + if (contentNode != null) { + contentNode.checkRequiredFields([_mediaTypePattern]); + contentNode.checkAllowedFields([ + _mediaTypePattern, + _extensionPattern, + ]); + + if (contentNode.nodes.length > 1) { + throw Exception('OpenAPI header has multiple content types'); + } + + final MapEntry(key: contentType, value: node) = + contentNode.yamlNodes.first; + final mediaTypeNode = node.getAs(); + if (mediaTypeNode == null) { + throw Exception('OpenAPI media type was not provided'); + } + + final mediaType = _loadMediaType( + mediaTypeNode, + ref: '$ref/content/$contentType', + ); + parameter.content = ( + MediaType.parse(contentType), + mediaType.build(), + ); + } + + return parameter.build(); + } + + OpenApiComponentOrRef _loadRequestBodyOrRef( + YamlMap requestBodyNode, { + required String ref, + }) { + if (requestBodyNode.nodes.containsKey(r'$ref')) { + return OpenApiComponentOrRef.reference( + ref: ref, + node: requestBodyNode, + reference: _ref( + requestBodyNode, + ), + ); + } + return OpenApiComponentOrRef.component( + ref: ref, + component: _loadRequestBody(requestBodyNode, ref: ref), + ); + } + + OpenApiRequestBody _loadRequestBody( + YamlMap requestBodyNode, { + required String ref, + }) { + if (requestBodyNode.nodes.containsKey(r'$ref')) { + throw Exception('OpenAPI request body reference is not allowed'); + } + + requestBodyNode.checkAllowedFields([ + 'content', + 'description', + 'required', + _extensionPattern, + ]); + + final requestBody = OpenApiRequestBodyBuilder() + ..ref = ref + ..node = requestBodyNode + ..extensions = _loadExtensions(requestBodyNode); + requestBody.description = + requestBodyNode.nodes['description']?.value as String?; + requestBody.required = requestBodyNode.nodes['required']?.value as bool?; + + final contentNode = requestBodyNode.nodes['content'].getAs(); + if (contentNode != null) { + contentNode.checkAllowedFields([ + 'examples', + _mediaTypePattern, + _extensionPattern, + ]); + + for (final entry in contentNode.yamlNodes) { + final mediaTypeNode = entry.value.getAs(); + if (mediaTypeNode == null) { + throw Exception('OpenAPI media type is not a map'); + } + + final mediaType = _loadMediaType( + mediaTypeNode, + ref: '$ref/content/${entry.key}', + ); + requestBody.content[MediaType.parse(entry.key)] = mediaType.build(); + } + } + + return requestBody.build(); + } + + OpenApiComponentOrRef _loadHeaderOrRef( + YamlMap headerNode, { + required String ref, + }) { + if (headerNode.nodes.containsKey(r'$ref')) { + return OpenApiComponentOrRef.reference( + ref: ref, + node: headerNode, + reference: _ref(headerNode), + ); + } + return OpenApiComponentOrRef.component( + ref: ref, + component: _loadHeader(headerNode, ref: ref), + ); + } + + OpenApiHeader _loadHeader( + YamlMap headerNode, { + required String ref, + }) { + if (headerNode.nodes.containsKey(r'$ref')) { + throw Exception('OpenAPI header reference is not allowed'); + } + + headerNode.checkAllowedFields([ + 'allowEmptyValue', + 'content', + 'deprecated', + 'description', + 'example', + 'examples', + 'explode', + 'required', + 'schema', + 'style', + _extensionPattern, + ]); + + final header = OpenApiHeaderBuilder() + ..ref = ref + ..node = headerNode + ..extensions = _loadExtensions(headerNode); + header.description = headerNode.nodes['description']?.value as String?; + header.required = headerNode.nodes['required']?.value as bool? ?? false; + + final schemaNode = headerNode.nodes['schema'].getAs(); + if (schemaNode != null) { + final schema = _loadSchemaOrRef( + schemaNode, + ref: '$ref/schema', + ); + header.schema.replace(schema); + } + + final contentNode = headerNode.nodes['content'].getAs(); + if (contentNode != null) { + contentNode.checkRequiredFields([_mediaTypePattern]); + contentNode.checkAllowedFields([ + _mediaTypePattern, + _extensionPattern, + ]); + + if (contentNode.nodes.length > 1) { + throw Exception('OpenAPI header has multiple content types'); + } + + final MapEntry(key: contentType, value: node) = + contentNode.yamlNodes.first; + final mediaTypeNode = node.getAs(); + if (mediaTypeNode == null) { + throw Exception('OpenAPI media type was not provided'); + } + + final mediaType = _loadMediaType( + mediaTypeNode, + ref: '$ref/content/$contentType', + ); + header.content = ( + MediaType.parse(contentType), + mediaType.build(), + ); + } + + return header.build(); + } + + OpenApiMediaTypeBuilder _loadMediaType( + YamlMap mediaTypeNode, { + required String ref, + }) { + mediaTypeNode.checkRequiredFields(['schema']); + mediaTypeNode.checkAllowedFields([ + 'example', + 'examples', + 'encoding', + 'schema', + _extensionPattern, + ]); + + final mediaType = OpenApiMediaTypeBuilder() + ..ref = ref + ..node = mediaTypeNode + ..extensions = _loadExtensions(mediaTypeNode); + // mediaType.example = mediaTypeNode.nodes['example']?.value as String?; + final schemaNode = mediaTypeNode.nodes['schema'].getAs()!; + final schema = _loadSchemaOrRef( + schemaNode, + ref: '$ref/schema', + ); + mediaType.schema.replace(schema); + + final encodingNode = mediaTypeNode.nodes['encoding'].getAs(); + if (encodingNode != null) { + for (final entry in encodingNode.yamlNodes) { + final encodingNode = entry.value.getAs()!; + encodingNode.checkAllowedFields([ + 'allowReserved', + 'contentType', + 'explode', + 'headers', + 'style', + _extensionPattern, + ]); + + final encoding = OpenApiEncodingBuilder() + ..ref = '$ref/encoding/${entry.key}' + ..node = encodingNode + ..allowReserved = encodingNode.nodes['allowReserved']?.value as bool? + ..extensions = _loadExtensions(encodingNode); + + var contentType = encodingNode.nodes['contentType']?.value as String?; + contentType ??= schema.defaultContentType(components); + encoding.contentType = MediaType.parse(contentType); + + // https://spec.openapis.org/oas/v3.1.0#fixed-fields-12 + const ignoreExplode = [ + 'application/x-www-form-urlencoded', + 'multipart/form-data', + ]; + if (!ignoreExplode.contains(contentType)) { + encoding.explode = + encodingNode.nodes['explode']?.value as bool? ?? false; + } + + // https://spec.openapis.org/oas/v3.1.0#fixed-fields-12 + const ignoreStyle = [ + 'application/x-www-form-urlencoded', + 'multipart/form-data', + ]; + if (!ignoreStyle.contains(contentType)) { + final style = encodingNode.nodes['style']?.value as String?; + if (style != null) { + encoding.style = OpenApiParameterStyle.valueOf(style); + } + } + + final headersNode = encodingNode.nodes['headers'].getAs(); + if (headersNode != null) { + for (final headerEntry in headersNode.yamlNodes) { + final headerNode = headerEntry.value.getAs(); + if (headerNode == null) { + throw Exception('OpenAPI header is not a map'); + } + + final header = _loadHeaderOrRef( + headerNode, + ref: '$ref/encoding/${entry.key}/headers/${headerEntry.key}', + ); + encoding.headers[headerEntry.key] = header; + } + } + + mediaType.encoding[entry.key] = encoding.build(); + } + } + + return mediaType; + } + + OpenApiSecurityScheme _loadSecurityScheme( + YamlMap securitySchemeNode, { + required String ref, + }) { + securitySchemeNode.checkRequiredFields(['type']); + securitySchemeNode.checkAllowedFields([ + 'type', + 'description', + 'name', + 'in', + 'scheme', + 'bearerFormat', + 'flows', + 'openIdConnectUrl', + _extensionPattern, + ]); + + final securityScheme = OpenApiSecuritySchemeBuilder() + ..ref = ref + ..node = securitySchemeNode + ..extensions = _loadExtensions(securitySchemeNode); + + final type = securitySchemeNode.nodes['type'].getScalar(); + securityScheme.type = OpenApiSecuritySchemeType.valueOf(type); + + securityScheme.description = + securitySchemeNode.nodes['description']?.value as String?; + securityScheme.name = securitySchemeNode.nodes['name']?.value as String?; + if (securitySchemeNode.nodes['in']?.value case final String location) { + securityScheme.location = OpenApiParameterLocation.valueOf(location); + } + securityScheme.scheme = + securitySchemeNode.nodes['scheme']?.value as String?; + securityScheme.bearerFormat = + securitySchemeNode.nodes['bearerFormat']?.value as String?; + if (securitySchemeNode.nodes['flows'].getAs() + case final flowsNode?) { + securityScheme.flows = _loadOAuthFlows(flowsNode, ref: '$ref/flows'); + } + securityScheme.openIdConnectUrl = + securitySchemeNode.nodes['openIdConnectUrl']?.value as String?; + + return securityScheme.build(); + } + + OpenApiOAuthFlowsBuilder _loadOAuthFlows( + YamlMap flowsNode, { + required String ref, + }) { + flowsNode.checkAllowedFields([ + 'implicit', + 'password', + 'clientCredentials', + 'authorizationCode', + _extensionPattern, + ]); + + final flows = OpenApiOAuthFlowsBuilder() + ..ref = ref + ..node = flowsNode + ..extensions = _loadExtensions(flowsNode); + if (flowsNode.nodes['authorizationCode']?.getAs() + case final authorizationCodeNode?) { + flows.authorizationCode = _loadOAuthFlow( + authorizationCodeNode, + ref: '$ref/authorizationCode', + ); + } + if (flowsNode.nodes['clientCredentials']?.getAs() + case final clientCredentialsNode?) { + flows.clientCredentials = _loadOAuthFlow( + clientCredentialsNode, + ref: '$ref/clientCredentials', + ); + } + if (flowsNode.nodes['implicit']?.getAs() + case final implicitNode?) { + flows.implicit = _loadOAuthFlow(implicitNode, ref: '$ref/implicit'); + } + if (flowsNode.nodes['password']?.getAs() + case final passwordNode?) { + flows.password = _loadOAuthFlow(passwordNode, ref: '$ref/password'); + } + return flows; + } + + OpenApiOAuthFlowBuilder _loadOAuthFlow( + YamlMap flowNode, { + required String ref, + }) { + flowNode.checkAllowedFields([ + 'authorizationUrl', + 'tokenUrl', + 'refreshUrl', + 'scopes', + _extensionPattern, + ]); + + final flow = OpenApiOAuthFlowBuilder() + ..ref = ref + ..node = flowNode + ..extensions = _loadExtensions(flowNode); + flow.authorizationUrl = + flowNode.nodes['authorizationUrl']?.value as String?; + flow.tokenUrl = flowNode.nodes['tokenUrl']?.value as String?; + flow.refreshUrl = flowNode.nodes['refreshUrl']?.value as String?; + flow.scopes.addEntries( + flowNode.nodes['scopes'] + .getAs()! + .yamlNodes + .map((entry) => MapEntry(entry.key, entry.value.getScalar())), + ); + return flow; + } +} + +extension on OpenApiComponentOrRef { + String defaultContentType(OpenApiComponents components) { + final schema = resolve(components); + return switch (schema.type?.value) { + JsonType.object => 'application/json', + JsonType.array => schema.items!.defaultContentType(components), + _ => 'application/octet-stream', + }; + } +} + +extension on YamlMap { + Iterable> get yamlNodes => + nodes.entries.map((entry) { + final key = switch (entry.key) { + final String key => key, + YamlScalar(value: final String key) => key, + _ => throw Exception( + 'Invalid key: $entry. Expected String or YamlScalar, ' + // ignore: avoid_dynamic_calls + 'got ${entry.key?.runtimeType}', + ), + }; + return MapEntry(key, entry.value); + }); +} + +extension on YamlNode? { + T getScalar({ + String? ref, + }) { + final this_ = this; + if (this_ is! YamlScalar) { + throw ArgumentError( + this_, + 'Expected a YamlScalar but got a $runtimeType. ' + 'ref=$ref, context=${this_?.span.highlight()}', + ); + } + final value = this_.value; + if (value is! T) { + if (T == String) { + switch (value) { + // TODO(dnys1): Improve... YAML decodes "- " in list as null + case null: + return '' as T; + // TODO(dnys1): Improve... YAML decodes "- true" in list as bool + case true || false: + return value.toString() as T; + } + } + throw ArgumentError( + this_, + 'Expected a $T but got a $runtimeType. ' + 'ref=$ref, context=${this_.span.highlight()}', + ); + } + return value; + } +} + +extension on YamlNode? { + Node? getAs() { + final this_ = this; + if (this_ == null) { + return null; + } + if (this_ is! Node) { + throw Exception('Expected a $Node but got a $runtimeType'); + } + return this_; + } +} + +extension on YamlMap { + void checkRequiredFields(Iterable requiredFields) { + final unmatched = List.of(requiredFields); + for (final MapEntry(:key) in value.entries) { + if (key is String) { + for (final requiredField in requiredFields) { + if (requiredField.allMatches(key).isNotEmpty) { + unmatched.remove(requiredField); + break; + } + } + } + } + if (unmatched.isNotEmpty) { + // TODO(dnys1): Use location in errors + // final location = span; + throw Exception('Missing required OpenAPI fields: $unmatched ($this)'); + } + } + + void checkAllowedFields(Iterable allowedPatterns) { + final invalid = <(String, YamlNode)>[]; + for (final MapEntry(:key, value: node) in yamlNodes) { + var goodKey = false; + for (final allowedPattern in allowedPatterns) { + if (allowedPattern.allMatches(key).isNotEmpty) { + goodKey = true; + break; + } + } + if (!goodKey) { + invalid.add((key, node)); + } + } + if (invalid.isNotEmpty) { + throw Exception('Invalid keys: $invalid ($this)'); + } + } +} + +extension on T { + R let(R Function(T) block) => block(this); +} diff --git a/apps/cli/lib/src/openapi/renderer/openapi_renderer.dart b/apps/cli/lib/src/openapi/renderer/openapi_renderer.dart new file mode 100644 index 000000000..54f8d7452 --- /dev/null +++ b/apps/cli/lib/src/openapi/renderer/openapi_renderer.dart @@ -0,0 +1,858 @@ +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:celest_cli/src/openapi/ast/openapi_ast.dart'; +import 'package:celest_cli/src/openapi/ast/openapi_visitor.dart'; +import 'package:source_span/source_span.dart'; +// ignore: implementation_imports +import 'package:yaml/src/null_span.dart'; +import 'package:yaml/yaml.dart'; +import 'package:yaml_edit/yaml_edit.dart'; + +extension OpenApiRenderer on OpenApiDocument { + YamlDocument toYamlDocument() { + final renderer = _OpenApiDocumentRenderer(); + final contents = accept(renderer); + final rendered = contents.toString(); + return YamlDocument.internal( + contents, + SourceFile.fromString(rendered).span(0), + null, + const [], + ); + } + + String toYaml() { + final renderer = _OpenApiRenderer(); + accept(renderer); + return renderer._editor.toString(); + } +} + +final class _OpenApiRenderer extends _OpenApiDocumentRenderer { + _OpenApiRenderer() : super(useCachedNode: false); + + late final YamlEditor _editor; + + @override + YamlNode visitDocument(OpenApiDocument document) { + _editor = YamlEditor(''' +openapi: +info: +servers: +paths: +components: + schemas: + responses: + parameters: + requestBodies: + headers: + paths: + securitySchemes: +security: +externalDocs: +tags: +'''); + // Always use the document version as specified if available. + final version = switch (document.node) { + final YamlMap node => YamlScalar.wrap( + node.nodes['openapi']?.value, + style: ScalarStyle.SINGLE_QUOTED, + ), + _ => YamlScalar.wrap( + document.version.toString(), + style: ScalarStyle.SINGLE_QUOTED, + ), + }; + _editor.update(['openapi'], version); + _editor.update(['info'], document.info.accept(this)); + if (document.servers.isNotEmpty) { + _editor.update( + ['servers'], + _list( + document.servers.map((server) => server.accept(this)).toList(), + ), + ); + } else { + _editor.remove(['servers']); + } + if (document.paths.isNotEmpty) { + _editor.update( + ['paths'], + _map({ + for (final entry in document.paths.entries) + YamlScalar.wrap(entry.key, style: ScalarStyle.SINGLE_QUOTED): + entry.value.accept(this), + }), + ); + } else { + _editor.remove(['paths']); + } + if (document.components.schemas.isNotEmpty) { + _editor.update( + ['components', 'schemas'], + _map({ + for (final entry in document.components.schemas.entries) + entry.key: entry.value.accept(this), + }), + ); + } else { + _editor.remove(['components', 'schemas']); + } + if (document.components.responses.isNotEmpty) { + _editor.update( + ['components', 'responses'], + _map({ + for (final entry in document.components.responses.entries) + entry.key: entry.value.accept(this), + }), + ); + } else { + _editor.remove(['components', 'responses']); + } + if (document.components.parameters.isNotEmpty) { + _editor.update( + ['components', 'parameters'], + _map({ + for (final entry in document.components.parameters.entries) + entry.key: entry.value.accept(this), + }), + ); + } else { + _editor.remove(['components', 'parameters']); + } + if (document.components.requestBodies.isNotEmpty) { + _editor.update( + ['components', 'requestBodies'], + _map({ + for (final entry in document.components.requestBodies.entries) + entry.key: entry.value.accept(this), + }), + ); + } else { + _editor.remove(['components', 'requestBodies']); + } + if (document.components.headers.isNotEmpty) { + _editor.update( + ['components', 'headers'], + _map({ + for (final entry in document.components.headers.entries) + entry.key: entry.value.accept(this), + }), + ); + } else { + _editor.remove(['components', 'headers']); + } + if (document.components.paths.isNotEmpty) { + _editor.update( + ['components', 'paths'], + _map({ + for (final entry in document.components.paths.entries) + YamlScalar.wrap(entry.key, style: ScalarStyle.SINGLE_QUOTED): + entry.value.accept(this), + }), + ); + } else { + _editor.remove(['components', 'paths']); + } + if (document.components.securitySchemes.isNotEmpty) { + _editor.update( + ['components', 'securitySchemes'], + _map({ + for (final entry in document.components.securitySchemes.entries) + entry.key: entry.value.accept(this), + }), + ); + } else { + _editor.remove(['components', 'securitySchemes']); + } + if (document.securityRequirements.isNotEmpty) { + _editor.update( + ['security'], + _list( + document.securityRequirements + .map((requirement) => requirement.accept(this)) + .toList(), + ), + ); + } else { + _editor.remove(['security']); + } + if (document.externalDocs case final externalDocs?) { + _editor.update(['externalDocs'], externalDocs.accept(this)); + } else { + _editor.remove(['externalDocs']); + } + if (document.tags.isNotEmpty) { + _editor.update( + ['tags'], + _list(document.tags.map((tag) => tag.accept(this)).toList()), + ); + } else { + _editor.remove(['tags']); + } + if (document.extensions case final extensions? when extensions.isNotEmpty) { + extensions.forEach((key, value) { + _editor.update([key], value.value); + }); + } + return super.visitDocument(document); + } +} + +YamlMap _map(Map nodes) { + return wrapAsYamlNode( + nodes.map( + (key, value) => MapEntry( + key is YamlNode ? key : YamlScalar.wrap(key), + switch (value) { + YamlScalar(value: List() || Map()) => value.value, + _ => value, + }, + ), + ), + collectionStyle: CollectionStyle.BLOCK, + ) as YamlMap; +} + +YamlList _list(Iterable nodes) { + return wrapAsYamlNode( + YamlList.internal( + nodes.toList(), + NullSpan(null), + CollectionStyle.BLOCK, + ), + collectionStyle: CollectionStyle.BLOCK, + ) as YamlList; +} + +final class _OpenApiDocumentRenderer extends OpenApiVisitor { + _OpenApiDocumentRenderer({ + this.useCachedNode = true, + }); + + final bool useCachedNode; + + @override + YamlNode visitDocument(OpenApiDocument document) { + if (document.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'openapi': YamlScalar.wrap( + document.version.toString(), + style: ScalarStyle.SINGLE_QUOTED, + ), + 'info': document.info.accept(this), + if (document.servers.isNotEmpty) + 'servers': _list( + document.servers.map((server) => server.accept(this)), + ), + if (document.paths.isNotEmpty) + 'paths': _map({ + for (final entry in document.paths.entries) + YamlScalar.wrap(entry.key, style: ScalarStyle.SINGLE_QUOTED): + entry.value.accept(this), + }), + 'components': document.components.accept(this), + if (document.securityRequirements.isNotEmpty) + 'security': _list([ + for (final requirement in document.securityRequirements) + requirement.accept(this), + ]), + ...?document.extensions?.toYaml(), + }); + } + + @override + YamlNode visitComponents(OpenApiComponents components) { + if (components.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'schemas': _map({ + for (final entry in components.schemas.entries) + entry.key: entry.value.accept(this), + }), + 'responses': _map({ + for (final entry in components.responses.entries) + entry.key: entry.value.accept(this), + }), + 'parameters': _map({ + for (final entry in components.parameters.entries) + entry.key: entry.value.accept(this), + }), + 'requestBodies': _map({ + for (final entry in components.requestBodies.entries) + entry.key: entry.value.accept(this), + }), + 'headers': _map({ + for (final entry in components.headers.entries) + entry.key: entry.value.accept(this), + }), + 'paths': _map({ + for (final entry in components.paths.entries) + YamlScalar.wrap(entry.key, style: ScalarStyle.SINGLE_QUOTED): + entry.value.accept(this), + }), + 'securitySchemes': _map({ + for (final entry in components.securitySchemes.entries) + entry.key: entry.value.accept(this), + }), + ...?components.extensions?.toYaml(), + }); + } + + @override + YamlNode visitContact(OpenApiContact contact) { + if (contact.node case final node? when useCachedNode) { + return node; + } + return _map({ + if (contact.name case final name?) 'name': YamlScalar.wrap(name), + if (contact.url case final url?) 'url': YamlScalar.wrap(url), + if (contact.email case final email?) 'email': YamlScalar.wrap(email), + ...?contact.extensions?.toYaml(), + }); + } + + @override + YamlNode visitDiscriminator(OpenApiDiscriminator discriminator) { + if (discriminator.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'propertyName': YamlScalar.wrap(discriminator.propertyName), + if (discriminator.mapping case final mapping? when mapping.isNotEmpty) + 'mapping': _map({ + for (final entry in mapping.entries) + entry.key: YamlScalar.wrap( + entry.value, + style: ScalarStyle.SINGLE_QUOTED, + ), + }), + ...?discriminator.extensions?.toYaml(), + }); + } + + @override + YamlNode visitEncoding(OpenApiEncoding encoding) { + if (encoding.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'contentType': YamlScalar.wrap(encoding.contentType.toString()), + if (encoding.headers.isNotEmpty) + 'headers': _map({ + for (final entry in encoding.headers.entries) + entry.key: entry.value.accept(this), + }), + if (encoding.style case final style?) + 'style': YamlScalar.wrap(style.name), + if (encoding.explode != null) + 'explode': YamlScalar.wrap(encoding.explode), + if (encoding.allowReserved != null) + 'allowReserved': YamlScalar.wrap(encoding.allowReserved), + ...?encoding.extensions?.toYaml(), + }); + } + + @override + YamlNode visitExternalDocs(OpenApiExternalDocs externalDocs) { + if (externalDocs.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'url': YamlScalar.wrap(externalDocs.url), + if (externalDocs.description != null) + 'description': YamlScalar.wrap(externalDocs.description), + ...?externalDocs.extensions?.toYaml(), + }); + } + + @override + YamlNode visitHeader(OpenApiHeader header) { + if (header.node case final node? when useCachedNode) { + return node; + } + return _map({ + if (header.description != null) + 'description': YamlScalar.wrap( + header.description, + style: ScalarStyle.LITERAL, + ), + if (header.required case final required?) + 'required': YamlScalar.wrap(required), + if (header.deprecated case final deprecated?) + 'deprecated': YamlScalar.wrap(deprecated), + if (header.allowEmptyValue case final allowEmptyValue?) + 'allowEmptyValue': YamlScalar.wrap(allowEmptyValue), + if (header.style case final style?) 'style': YamlScalar.wrap(style.name), + if (header.explode case final explode?) + 'explode': YamlScalar.wrap(explode), + if (header.allowReserved case final allowReserved?) + 'allowReserved': YamlScalar.wrap(allowReserved), + if (header.schema case final schema) 'schema': schema.accept(this), + if (header.content case final content?) + 'content': _map({ + content.$1.toString(): content.$2.accept(this), + }), + ...?header.extensions?.toYaml(), + }); + } + + @override + YamlNode visitInfo(OpenApiInfo info) { + if (info.node case final node? when useCachedNode) { + return node; + } + return _map({ + if (info.title != null) 'title': YamlScalar.wrap(info.title), + if (info.description != null) + 'description': YamlScalar.wrap( + info.description, + style: ScalarStyle.LITERAL, + ), + if (info.apiVersion != null) + 'version': YamlScalar.wrap( + info.apiVersion, + style: ScalarStyle.SINGLE_QUOTED, + ), + if (info.contact case final contact?) 'contact': contact.accept(this), + if (info.license case final license?) 'license': license.accept(this), + ...?info.extensions?.toYaml(), + }); + } + + @override + YamlNode visitLicense(OpenApiLicense license) { + if (license.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'name': YamlScalar.wrap(license.name), + if (license.identifier != null) + 'identifier': YamlScalar.wrap(license.identifier), + if (license.url != null) 'url': YamlScalar.wrap(license.url), + ...?license.extensions?.toYaml(), + }); + } + + @override + YamlNode visitMediaType(OpenApiMediaType mediaType) { + if (mediaType.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'schema': mediaType.schema.accept(this), + if (mediaType.encoding.isNotEmpty) + 'encoding': _map({ + for (final entry in mediaType.encoding.entries) + entry.key: entry.value.accept(this), + }), + ...?mediaType.extensions?.toYaml(), + }); + } + + @override + YamlNode visitOperation(OpenApiOperation operation) { + if (operation.node case final node? when useCachedNode) { + return node; + } + return _map({ + if (operation.tags.isNotEmpty) + 'tags': _list(operation.tags.map(YamlScalar.wrap)), + if (operation.summary != null) + 'summary': YamlScalar.wrap(operation.summary), + if (operation.description != null) + 'description': YamlScalar.wrap( + operation.description, + style: ScalarStyle.LITERAL, + ), + if (operation.deprecated != null) + 'deprecated': YamlScalar.wrap(operation.deprecated), + if (operation.operationId != null) + 'operationId': YamlScalar.wrap(operation.operationId), + if (operation.parameters.isNotEmpty) + 'parameters': _list( + operation.parameters + .map((parameter) => parameter.accept(this)) + .toList(), + ), + if (operation.requestBody case final requestBody?) + 'requestBody': requestBody.accept(this), + if (operation.responses.isNotEmpty || operation.defaultResponse != null) + 'responses': _map({ + for (final entry in operation.responses.entries) + YamlScalar.wrap( + entry.key.toString(), + style: ScalarStyle.SINGLE_QUOTED, + ): entry.value.accept(this), + if (operation.defaultResponse case final defaultResponse?) + 'default': defaultResponse.accept(this), + }), + if (operation.servers case final servers? when servers.isNotEmpty) + 'servers': _list( + servers.map((server) => server.accept(this)).toList(), + ), + ...?operation.extensions?.toYaml(), + }); + } + + @override + YamlNode visitParameter(OpenApiParameter parameter) { + if (parameter.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'name': YamlScalar.wrap(parameter.name), + 'in': YamlScalar.wrap(parameter.location.name), + if (parameter.required case final required?) + 'required': YamlScalar.wrap(required), + if (parameter.description != null) + 'description': YamlScalar.wrap( + parameter.description, + style: ScalarStyle.LITERAL, + ), + if (parameter.deprecated != null) + 'deprecated': YamlScalar.wrap(parameter.deprecated), + if (parameter.allowEmptyValue != null) + 'allowEmptyValue': YamlScalar.wrap(parameter.allowEmptyValue), + if (parameter.style case final style?) + 'style': YamlScalar.wrap(style.name), + if (parameter.explode case final explode?) + 'explode': YamlScalar.wrap(explode), + if (parameter.allowReserved case final allowReserved?) + 'allowReserved': YamlScalar.wrap(allowReserved), + if (parameter.schema case final schema?) 'schema': schema.accept(this), + if (parameter.content case final content?) + 'content': _map({ + content.$1.toString(): content.$2.accept(this), + }), + ...?parameter.extensions?.toYaml(), + }); + } + + @override + YamlNode visitPathItem(OpenApiPathItem pathItem) { + if (pathItem.node case final node? when useCachedNode) { + return node; + } + return _map({ + for (final operation in pathItem.operations.values) + operation.type.name: operation.accept(this), + if (pathItem.parameters.isNotEmpty) + 'parameters': _list( + pathItem.parameters + .map((parameter) => parameter.accept(this)) + .toList(), + ), + if (pathItem.servers case final servers? when servers.isNotEmpty) + 'servers': _list( + servers.map((server) => server.accept(this)).toList(), + ), + ...?pathItem.extensions?.toYaml(), + }); + } + + @override + YamlNode visitReference(OpenApiReference reference) { + if (reference.node case final node? when useCachedNode) { + return node; + } + return _map({ + r'$ref': YamlScalar.wrap( + reference.ref, + style: ScalarStyle.SINGLE_QUOTED, + ), + }); + } + + @override + YamlNode visitRequestBody(OpenApiRequestBody requestBody) { + if (requestBody.node case final node? when useCachedNode) { + return node; + } + return _map({ + if (requestBody.description != null) + 'description': YamlScalar.wrap( + requestBody.description, + style: ScalarStyle.LITERAL, + ), + if (requestBody.content.isNotEmpty) + 'content': _map({ + for (final entry in requestBody.content.entries) + entry.key.toString(): entry.value.accept(this), + }), + if (requestBody.required != null) + 'required': YamlScalar.wrap(requestBody.required), + ...?requestBody.extensions?.toYaml(), + }); + } + + @override + YamlNode visitResponse(OpenApiResponse response) { + if (response.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'description': YamlScalar.wrap( + response.description, + style: ScalarStyle.LITERAL, + ), + if (response.content case final content?) + 'content': _map({ + for (final entry in content.entries) + entry.key.toString(): entry.value.accept(this), + }), + if (response.headers case final headers?) + 'headers': _map({ + for (final entry in headers.entries) + entry.key: entry.value.accept(this), + }), + ...?response.extensions?.toYaml(), + }); + } + + @override + YamlNode visitSchema(OpenApiSchema schema) { + if (schema.node case final node? when useCachedNode) { + return node; + } + return _map({ + if (schema.title != null) 'title': YamlScalar.wrap(schema.title), + if (schema.description != null) + 'description': YamlScalar.wrap( + schema.description, + style: ScalarStyle.LITERAL, + ), + if (schema.type case final type?) + 'type': switch (type) { + ItemValue() => YamlScalar.wrap(type.value.toYaml()), + ItemList() => _list(type.map((it) => YamlScalar.wrap(it.toYaml()))), + }, + if (schema.nullable case final nullable?) + 'nullable': YamlScalar.wrap(nullable), + if (schema.allOf case final allOf? when allOf.isNotEmpty) + 'allOf': _list( + allOf.map((schema) => schema.accept(this)).toList(), + ), + if (schema.oneOf case final oneOf? when oneOf.isNotEmpty) + 'oneOf': _list( + oneOf.map((schema) => schema.accept(this)).toList(), + ), + if (schema.anyOf case final anyOf? when anyOf.isNotEmpty) + 'anyOf': _list( + anyOf.map((schema) => schema.accept(this)).toList(), + ), + if (schema.items case final items?) 'items': items.accept(this), + if (schema.maxItems case final maxItems?) + 'maxItems': YamlScalar.wrap(maxItems), + if (schema.minItems case final minItems?) + 'minItems': YamlScalar.wrap(minItems), + if (schema.uniqueItems case final uniqueItems?) + 'uniqueItems': YamlScalar.wrap(uniqueItems), + if (schema.properties case final properties? when properties.isNotEmpty) + 'properties': _map({ + for (final entry in properties.entries) + entry.key: entry.value.accept(this), + }), + if (schema.additionalProperties case final additionalProperties?) + 'additionalProperties': additionalProperties.accept(this), + if (schema.minProperties case final minProperties?) + 'minProperties': YamlScalar.wrap(minProperties), + if (schema.maxProperties case final maxProperties?) + 'maxProperties': YamlScalar.wrap(maxProperties), + if (schema.required case final required? when required.isNotEmpty) + 'required': _list(required.map(YamlScalar.wrap)), + if (schema.format case final format?) 'format': YamlScalar.wrap(format), + if (schema.multipleOf case final multipleOf?) + 'multipleOf': YamlScalar.wrap(multipleOf), + if (schema.maximum case final maximum?) + 'maximum': YamlScalar.wrap(maximum), + if (schema.exclusiveMaximum case final exclusiveMaximum?) + 'exclusiveMaximum': YamlScalar.wrap(exclusiveMaximum), + if (schema.minimum case final minimum?) + 'minimum': YamlScalar.wrap(minimum), + if (schema.exclusiveMinimum case final exclusiveMinimum?) + 'exclusiveMinimum': YamlScalar.wrap(exclusiveMinimum), + if (schema.maxLength case final maxLength?) + 'maxLength': YamlScalar.wrap(maxLength), + if (schema.minLength case final minLength?) + 'minLength': YamlScalar.wrap(minLength), + if (schema.pattern != null) 'pattern': YamlScalar.wrap(schema.pattern), + if (schema.enumValues case final enumValues? when enumValues.isNotEmpty) + 'enum': _list(enumValues.map(YamlScalar.wrap)), + if (schema.discriminator case final discriminator?) + 'discriminator': discriminator.accept(this), + if (schema.deprecated case final deprecated?) + 'deprecated': YamlScalar.wrap(deprecated), + if (schema.defaultValue case final defaultValue?) + 'default': wrapAsYamlNode( + defaultValue, + collectionStyle: CollectionStyle.FLOW, + scalarStyle: ScalarStyle.PLAIN, + ), + if (schema.readOnly case final readOnly?) + 'readOnly': YamlScalar.wrap(readOnly), + if (schema.writeOnly case final writeOnly?) + 'writeOnly': YamlScalar.wrap(writeOnly), + if (schema.example case final example?) + 'example': wrapAsYamlNode(example.value), + ...?schema.extensions?.toYaml(), + }); + } + + @override + YamlNode visitAdditionalProperties( + OpenApiAdditionalProperties additionalProperties, + ) { + if (additionalProperties.node case final node? when useCachedNode) { + return node; + } + if (additionalProperties.allow case final allow?) { + return YamlScalar.wrap(allow); + } + if (additionalProperties.schema case final schema?) { + return schema.accept(this); + } + throw StateError( + 'Expected either allow or schema, got $additionalProperties', + ); + } + + @override + YamlNode visitServer(OpenApiServer server) { + if (server.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'url': YamlScalar.wrap(server.url), + if (server.description != null) + 'description': YamlScalar.wrap(server.description), + if (server.variables.isNotEmpty) + 'variables': _map({ + for (final MapEntry(:key, :value) in server.variables.entries) + key: value.accept(this), + }), + ...?server.extensions?.toYaml(), + }); + } + + @override + YamlNode visitServerVariable(OpenApiServerVariable serverVariable) { + if (serverVariable.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'default': YamlScalar.wrap(serverVariable.defaultValue), + if (serverVariable.enumValues case final enumValues? + when enumValues.isNotEmpty) + 'enum': _list(enumValues.map(YamlScalar.wrap)), + if (serverVariable.description != null) + 'description': YamlScalar.wrap(serverVariable.description), + ...?serverVariable.extensions?.toYaml(), + }); + } + + @override + YamlNode visitTag(OpenApiTag tag) { + if (tag.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'name': YamlScalar.wrap(tag.name), + if (tag.description case final description?) + 'description': YamlScalar.wrap(description), + if (tag.externalDocs case final externalDocs?) + 'externalDocs': externalDocs.accept(this), + ...?tag.extensions?.toYaml(), + }); + } + + @override + YamlNode visitOAuthFlow(OpenApiOAuthFlow oauthFlow) { + if (oauthFlow.node case final node? when useCachedNode) { + return node; + } + return _map({ + if (oauthFlow.authorizationUrl case final authorizationUrl?) + 'authorizationUrl': YamlScalar.wrap(authorizationUrl), + if (oauthFlow.tokenUrl case final tokenUrl?) + 'tokenUrl': YamlScalar.wrap(tokenUrl), + if (oauthFlow.refreshUrl case final refreshUrl?) + 'refreshUrl': YamlScalar.wrap(refreshUrl), + if (oauthFlow.scopes.isNotEmpty) + 'scopes': _map({ + for (final entry in oauthFlow.scopes.entries) + entry.key: YamlScalar.wrap(entry.value), + }), + ...?oauthFlow.extensions?.toYaml(), + }); + } + + @override + YamlNode visitOAuthFlows(OpenApiOAuthFlows oauthFlows) { + if (oauthFlows.node case final node? when useCachedNode) { + return node; + } + return _map({ + if (oauthFlows.implicit case final implicit?) + 'implicit': implicit.accept(this), + if (oauthFlows.password case final password?) + 'password': password.accept(this), + if (oauthFlows.clientCredentials case final clientCredentials?) + 'clientCredentials': clientCredentials.accept(this), + if (oauthFlows.authorizationCode case final authorizationCode?) + 'authorizationCode': authorizationCode.accept(this), + ...?oauthFlows.extensions?.toYaml(), + }); + } + + @override + YamlNode visitSecurityScheme(OpenApiSecurityScheme securityScheme) { + if (securityScheme.node case final node? when useCachedNode) { + return node; + } + return _map({ + 'type': YamlScalar.wrap(securityScheme.type.name), + if (securityScheme.description case final description?) + 'description': YamlScalar.wrap(description), + if (securityScheme.name case final name?) 'name': YamlScalar.wrap(name), + if (securityScheme.location case final location?) + 'in': YamlScalar.wrap(location.name), + if (securityScheme.scheme case final scheme?) + 'scheme': YamlScalar.wrap(scheme), + if (securityScheme.bearerFormat case final bearerFormat?) + 'bearerFormat': YamlScalar.wrap(bearerFormat), + if (securityScheme.flows case final flows?) 'flows': flows.accept(this), + if (securityScheme.openIdConnectUrl case final openIdConnectUrl?) + 'openIdConnectUrl': YamlScalar.wrap(openIdConnectUrl), + ...?securityScheme.extensions?.toYaml(), + }); + } + + @override + YamlNode visitSecurityRequirement( + OpenApiSecurityRequirement securityRequirement, + ) { + if (securityRequirement.node case final node? when useCachedNode) { + return node; + } + return _map({ + for (final entry in securityRequirement.schemes.entries) + entry.key: _list(entry.value.map(YamlScalar.wrap)), + ...?securityRequirement.extensions?.toYaml(), + }); + } +} + +extension on BuiltMap { + Map toYaml() => { + for (final entry in entries) + entry.key: switch (entry.value.value) { + final Iterable list => _list(list.map(wrapAsYamlNode)), + final Map map => _map(map.cast()), + final value => YamlScalar.wrap(value), + }, + }; +} diff --git a/apps/cli/lib/src/openapi/type/json_type.dart b/apps/cli/lib/src/openapi/type/json_type.dart new file mode 100644 index 000000000..46a521c47 --- /dev/null +++ b/apps/cli/lib/src/openapi/type/json_type.dart @@ -0,0 +1,34 @@ +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'json_type.g.dart'; + +class JsonType extends EnumClass { + const JsonType._(super.name); + + static const JsonType array = _$array; + static const JsonType object = _$object; + static const JsonType boolean = _$boolean; + static const JsonType number = _$number; + static const JsonType integer = _$integer; + static const JsonType string = _$string; + + @BuiltValueEnumConst(wireName: 'null') + static const JsonType null$ = _$null$; + + static BuiltSet get values => _$JsonTypeValues; + static JsonType valueOf(String name) => _$JsonTypeValueOf(name); + + static JsonType fromYaml(String yaml) => switch (yaml) { + 'null' => null$, + _ => valueOf(yaml), + }; + + String toYaml() => switch (this) { + null$ => 'null', + _ => name, + }; + + static Serializer get serializer => _$jsonTypeSerializer; +} diff --git a/apps/cli/lib/src/openapi/type/json_type.g.dart b/apps/cli/lib/src/openapi/type/json_type.g.dart new file mode 100644 index 000000000..6c4c8191d --- /dev/null +++ b/apps/cli/lib/src/openapi/type/json_type.g.dart @@ -0,0 +1,76 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'json_type.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +const JsonType _$array = const JsonType._('array'); +const JsonType _$object = const JsonType._('object'); +const JsonType _$boolean = const JsonType._('boolean'); +const JsonType _$number = const JsonType._('number'); +const JsonType _$integer = const JsonType._('integer'); +const JsonType _$string = const JsonType._('string'); +const JsonType _$null$ = const JsonType._('null\$'); + +JsonType _$JsonTypeValueOf(String name) { + switch (name) { + case 'array': + return _$array; + case 'object': + return _$object; + case 'boolean': + return _$boolean; + case 'number': + return _$number; + case 'integer': + return _$integer; + case 'string': + return _$string; + case 'null\$': + return _$null$; + default: + throw new ArgumentError(name); + } +} + +final BuiltSet _$JsonTypeValues = + new BuiltSet(const [ + _$array, + _$object, + _$boolean, + _$number, + _$integer, + _$string, + _$null$, +]); + +Serializer _$jsonTypeSerializer = new _$JsonTypeSerializer(); + +class _$JsonTypeSerializer implements PrimitiveSerializer { + static const Map _toWire = const { + 'null\$': 'null', + }; + static const Map _fromWire = const { + 'null': 'null\$', + }; + + @override + final Iterable types = const [JsonType]; + @override + final String wireName = 'JsonType'; + + @override + Object serialize(Serializers serializers, JsonType object, + {FullType specifiedType = FullType.unspecified}) => + _toWire[object.name] ?? object.name; + + @override + JsonType deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) => + JsonType.valueOf( + _fromWire[serialized] ?? (serialized is String ? serialized : '')); +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/apps/cli/lib/src/openapi/type/json_type_format.spec.dart b/apps/cli/lib/src/openapi/type/json_type_format.spec.dart new file mode 100644 index 000000000..1773838a7 --- /dev/null +++ b/apps/cli/lib/src/openapi/type/json_type_format.spec.dart @@ -0,0 +1,280 @@ +// GENERATED CODE - run `tool/update_spec.dart` to update. +// ignore_for_file: type=lint + +import 'json_type.dart'; + +extension type const JsonTypeFormat(String _) implements String { + /// Base64url: Binary data encoded as a url-safe string as defined in [RFC4648](https://www.rfc-editor.org/rfc/rfc4648#section-5) + static const JsonTypeFormat base64url = JsonTypeFormat('base64url'); + + /// Binary: any sequence of octets + static const JsonTypeFormat binary = JsonTypeFormat('binary'); + + /// Byte: base64 encoded data as defined in [RFC4648](https://www.rfc-editor.org/rfc/rfc4648#section-4) + static const JsonTypeFormat byte = JsonTypeFormat('byte'); + + /// Char: A single character + static const JsonTypeFormat char = JsonTypeFormat('char'); + + /// Commonmark: commonmark-formatted text + static const JsonTypeFormat commonmark = JsonTypeFormat('commonmark'); + + /// Date Time: date and time as defined by date-time - [RFC3339](https://www.rfc-editor.org/rfc/rfc3339#section-5.6) + static const JsonTypeFormat dateTime = JsonTypeFormat('date-time'); + + /// Date: date as defined by full-date - [RFC3339](https://www.rfc-editor.org/rfc/rfc3339#section-5.6) + static const JsonTypeFormat date = JsonTypeFormat('date'); + + /// Decimal: A fixed point decimal number of unspecified precision and range + static const JsonTypeFormat decimal = JsonTypeFormat('decimal'); + + /// Decimal128: A decimal floating-point number with 34 significant decimal digits + static const JsonTypeFormat decimal128 = JsonTypeFormat('decimal128'); + + /// Double Int: an integer that can be stored in an IEEE 754 double-precision number without loss of precision + static const JsonTypeFormat doubleInt = JsonTypeFormat('double-int'); + + /// Double: double precision floating point number + static const JsonTypeFormat double = JsonTypeFormat('double'); + + /// Duration: duration as defined by duration - RFC3339 + static const JsonTypeFormat duration = JsonTypeFormat('duration'); + + /// Email: An email address as defined as Mailbox in RFC5321 + static const JsonTypeFormat email = JsonTypeFormat('email'); + + /// Float: single precision floating point number + static const JsonTypeFormat float = JsonTypeFormat('float'); + + /// Hostname: A host name as defined by RFC1123 + static const JsonTypeFormat hostname = JsonTypeFormat('hostname'); + + /// Html: HTML-formatted text + static const JsonTypeFormat html = JsonTypeFormat('html'); + + /// Http Date: date and time as defined by HTTP-date - [RFC7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) + static const JsonTypeFormat httpDate = JsonTypeFormat('http-date'); + + /// Idn Email: An email address as defined as Mailbox in RFC6531 + static const JsonTypeFormat idnEmail = JsonTypeFormat('idn-email'); + + /// Idn Hostname: An internationalized host name as defined by RFC5890 + static const JsonTypeFormat idnHostname = JsonTypeFormat('idn-hostname'); + + /// Int16: signed 16-bit integer + static const JsonTypeFormat int16 = JsonTypeFormat('int16'); + + /// Int32: signed 32-bit integer + static const JsonTypeFormat int32 = JsonTypeFormat('int32'); + + /// Int64: signed 64-bit integer + static const JsonTypeFormat int64 = JsonTypeFormat('int64'); + + /// Int8: signed 8-bit integer + static const JsonTypeFormat int8 = JsonTypeFormat('int8'); + + /// Ipv4: An IPv4 address as defined as dotted-quad by RFC2673 + static const JsonTypeFormat ipv4 = JsonTypeFormat('ipv4'); + + /// Ipv6: An IPv6 address as defined by RFC4673 + static const JsonTypeFormat ipv6 = JsonTypeFormat('ipv6'); + + /// Iri Reference: A Internationalized Resource Identifier as defined in RFC3987 + static const JsonTypeFormat iriReference = JsonTypeFormat('iri-reference'); + + /// Iri: A Internationalized Resource Identifier as defined in RFC3987 + static const JsonTypeFormat iri = JsonTypeFormat('iri'); + + /// Json Pointer: A JSON string representation of a JSON Pointer as defined in RFC6901 + static const JsonTypeFormat jsonPointer = JsonTypeFormat('json-pointer'); + + /// Media Range: A media type as defined by the `media-range` ABNF production in RFC9110. + static const JsonTypeFormat mediaRange = JsonTypeFormat('media-range'); + + /// Password: a string that hints to obscure the value. + static const JsonTypeFormat password = JsonTypeFormat('password'); + + /// Regex: A regular expression as defined in ECMA-262 + static const JsonTypeFormat regex = JsonTypeFormat('regex'); + + /// Relative Json Pointer: A JSON string representation of a relative JSON Pointer as defined in draft RFC 01 + static const JsonTypeFormat relativeJsonPointer = + JsonTypeFormat('relative-json-pointer'); + + /// Sf Binary: structured fields byte sequence as defined in [RFC8941] + static const JsonTypeFormat sfBinary = JsonTypeFormat('sf-binary'); + + /// Sf Boolean: structured fields boolean as defined in [RFC8941] + static const JsonTypeFormat sfBoolean = JsonTypeFormat('sf-boolean'); + + /// Sf Decimal: structured fields decimal as defined in [RFC8941] + static const JsonTypeFormat sfDecimal = JsonTypeFormat('sf-decimal'); + + /// Sf Integer: structured fields integer as defined in [RFC8941] + static const JsonTypeFormat sfInteger = JsonTypeFormat('sf-integer'); + + /// Sf String: structured fields string as defined in [RFC8941] + static const JsonTypeFormat sfString = JsonTypeFormat('sf-string'); + + /// Sf Token: structured fields token as defined in [RFC8941] + static const JsonTypeFormat sfToken = JsonTypeFormat('sf-token'); + + /// Time: time as defined by full-time - RFC3339 + static const JsonTypeFormat time = JsonTypeFormat('time'); + + /// Uint8: unsigned 8-bit integer + static const JsonTypeFormat uint8 = JsonTypeFormat('uint8'); + + /// Uri Reference: A URI reference as defined in [RFC3986](https://www.rfc-editor.org/info/rfc3986) + static const JsonTypeFormat uriReference = JsonTypeFormat('uri-reference'); + + /// Uri Template: A URI Template as defined in RFC6570 + static const JsonTypeFormat uriTemplate = JsonTypeFormat('uri-template'); + + /// Uri: A Uniform Resource Identifier as defined in RFC3986 + static const JsonTypeFormat uri = JsonTypeFormat('uri'); + + /// Uuid: A Universally Unique IDentifier as defined in RFC4122 + static const JsonTypeFormat uuid = JsonTypeFormat('uuid'); + + /// Valid base types for this format. + List? get baseTypes => switch (this) { + JsonTypeFormat.base64url => [ + JsonType.string, + ], + JsonTypeFormat.binary => [ + JsonType.string, + ], + JsonTypeFormat.byte => [ + JsonType.string, + ], + JsonTypeFormat.char => [ + JsonType.string, + ], + JsonTypeFormat.commonmark => [ + JsonType.string, + ], + JsonTypeFormat.dateTime => [ + JsonType.string, + ], + JsonTypeFormat.date => [ + JsonType.string, + ], + JsonTypeFormat.decimal => [ + JsonType.string, + JsonType.number, + ], + JsonTypeFormat.decimal128 => [ + JsonType.string, + JsonType.number, + ], + JsonTypeFormat.doubleInt => [ + JsonType.integer, + ], + JsonTypeFormat.double => [ + JsonType.number, + ], + JsonTypeFormat.duration => [ + JsonType.string, + ], + JsonTypeFormat.email => [ + JsonType.string, + ], + JsonTypeFormat.float => [ + JsonType.number, + ], + JsonTypeFormat.hostname => [ + JsonType.string, + ], + JsonTypeFormat.html => [ + JsonType.string, + ], + JsonTypeFormat.httpDate => [ + JsonType.string, + ], + JsonTypeFormat.idnEmail => [ + JsonType.string, + ], + JsonTypeFormat.idnHostname => [ + JsonType.string, + ], + JsonTypeFormat.int16 => [ + JsonType.number, + ], + JsonTypeFormat.int32 => [ + JsonType.number, + ], + JsonTypeFormat.int64 => [ + JsonType.number, + JsonType.string, + ], + JsonTypeFormat.int8 => [ + JsonType.number, + ], + JsonTypeFormat.ipv4 => [ + JsonType.string, + ], + JsonTypeFormat.ipv6 => [ + JsonType.string, + ], + JsonTypeFormat.iriReference => [ + JsonType.string, + ], + JsonTypeFormat.iri => [ + JsonType.string, + ], + JsonTypeFormat.jsonPointer => [ + JsonType.string, + ], + JsonTypeFormat.mediaRange => [ + JsonType.string, + ], + JsonTypeFormat.password => [ + JsonType.string, + ], + JsonTypeFormat.regex => [ + JsonType.string, + ], + JsonTypeFormat.relativeJsonPointer => [ + JsonType.string, + ], + JsonTypeFormat.sfBinary => [ + JsonType.string, + ], + JsonTypeFormat.sfBoolean => [ + JsonType.string, + ], + JsonTypeFormat.sfDecimal => [ + JsonType.number, + ], + JsonTypeFormat.sfInteger => [ + JsonType.integer, + JsonType.number, + ], + JsonTypeFormat.sfString => [ + JsonType.string, + ], + JsonTypeFormat.sfToken => [ + JsonType.string, + ], + JsonTypeFormat.time => [ + JsonType.string, + ], + JsonTypeFormat.uint8 => [ + JsonType.number, + ], + JsonTypeFormat.uriReference => [ + JsonType.string, + ], + JsonTypeFormat.uriTemplate => [ + JsonType.string, + ], + JsonTypeFormat.uri => [ + JsonType.string, + ], + JsonTypeFormat.uuid => [ + JsonType.string, + ], + _ => null, + }; +} diff --git a/apps/cli/lib/src/openapi/type/json_type_schema.dart b/apps/cli/lib/src/openapi/type/json_type_schema.dart new file mode 100644 index 000000000..694136815 --- /dev/null +++ b/apps/cli/lib/src/openapi/type/json_type_schema.dart @@ -0,0 +1,300 @@ +// ignore_for_file: avoid_positional_boolean_parameters + +import 'package:celest_cli/src/openapi/type/json_type_format.spec.dart'; + +/// A structural specification of a JSON type. +/// +/// This class and all its subtypes should be identifiable based on its structure +/// alone which allows for efficient linking later. No non-structural metadata +/// should be included in the type schema. +sealed class JsonTypeSchema { + const JsonTypeSchema({ + required bool? isNullable, + Map? extensions, + }) : isNullable = isNullable ?? false, + extensions = extensions ?? const {}; + + final bool isNullable; + final Map extensions; + + JsonTypeSchema withNullability(bool isNullable); +} + +final class JsonBooleanType extends JsonTypeSchema { + const JsonBooleanType({ + required super.isNullable, + super.extensions, + }); + + @override + JsonBooleanType withNullability(bool isNullable) { + return JsonBooleanType( + isNullable: isNullable, + extensions: extensions, + ); + } +} + +final class JsonIntegerType extends JsonTypeSchema { + const JsonIntegerType({ + required super.isNullable, + this.format, + super.extensions, + }); + + final JsonTypeFormat? format; + + @override + JsonIntegerType withNullability(bool isNullable) { + return JsonIntegerType( + isNullable: isNullable, + format: format, + extensions: extensions, + ); + } +} + +final class JsonNumberType extends JsonTypeSchema { + const JsonNumberType({ + required super.isNullable, + this.format, + super.extensions, + }); + + final JsonTypeFormat? format; + + @override + JsonNumberType withNullability(bool isNullable) { + return JsonNumberType( + isNullable: isNullable, + format: format, + extensions: extensions, + ); + } +} + +final class JsonStringType extends JsonTypeSchema { + const JsonStringType({ + required super.isNullable, + this.format, + super.extensions, + }); + + final JsonTypeFormat? format; + + @override + JsonStringType withNullability(bool isNullable) { + return JsonStringType( + isNullable: isNullable, + format: format, + extensions: extensions, + ); + } +} + +final class JsonNullType extends JsonTypeSchema { + const JsonNullType._() : super(isNullable: true); + + static const JsonNullType instance = JsonNullType._(); + + @override + JsonNullType withNullability(bool isNullable) { + // always nullable + return this; + } +} + +// additionalProperties = false +final class JsonEmptyType extends JsonTypeSchema { + const JsonEmptyType._() : super(isNullable: false); + + static const JsonEmptyType instance = JsonEmptyType._(); + + @override + JsonEmptyType withNullability(bool isNullable) { + // always non-nullable + return this; + } +} + +// additionalProperties = true +final class JsonAnyType extends JsonTypeSchema { + const JsonAnyType._() : super(isNullable: true); + + static const JsonAnyType instance = JsonAnyType._(); + + @override + JsonAnyType withNullability(bool isNullable) { + // always nullable + return this; + } +} + +// properties is! empty +// presence of additional properties will create a colocated [JsonRecordType]... or make the class implement Map +final class JsonObjectType extends JsonTypeSchema { + const JsonObjectType({ + required super.isNullable, + required this.required, + required this.properties, + required this.additionalProperties, + super.extensions, + }); + + final Set required; + final Map properties; + final JsonTypeSchema? additionalProperties; + + @override + JsonObjectType withNullability(bool isNullable) { + return JsonObjectType( + isNullable: isNullable, + properties: properties, + additionalProperties: additionalProperties, + required: required, + extensions: extensions, + ); + } +} + +// properties is empty +// addiitonalProperties is! empty +final class JsonRecordType extends JsonTypeSchema { + const JsonRecordType({ + required super.isNullable, + required this.additionalProperties, + super.extensions, + }); + + final JsonTypeSchema additionalProperties; + + @override + JsonRecordType withNullability(bool isNullable) { + return JsonRecordType( + isNullable: isNullable, + additionalProperties: additionalProperties, + extensions: extensions, + ); + } +} + +final class JsonArrayType extends JsonTypeSchema { + const JsonArrayType({ + required super.isNullable, + required this.items, + required this.uniqueItems, + super.extensions, + }); + + final JsonTypeSchema items; + final bool uniqueItems; + + @override + JsonArrayType withNullability(bool isNullable) { + return JsonArrayType( + isNullable: isNullable, + items: items, + uniqueItems: uniqueItems, + extensions: extensions, + ); + } +} + +final class JsonSingleValueType extends JsonTypeSchema { + JsonSingleValueType({ + required this.value, + required this.type, + super.extensions, + }) : super(isNullable: type.isNullable); + + final Object? value; // TODO(dnys1): dartgen constant value? + final JsonTypeSchema type; + + @override + JsonSingleValueType withNullability(bool isNullable) { + return JsonSingleValueType( + value: value, // assert conforms + type: type.withNullability(isNullable), + extensions: extensions, + ); + } +} + +final class JsonEnumType extends JsonTypeSchema { + JsonEnumType({ + required super.isNullable, + required this.values, + super.extensions, + }) : assert(values.isNotEmpty, 'Must have at least one value'); + + final List values; + + @override + JsonEnumType withNullability(bool isNullable) { + return JsonEnumType( + isNullable: isNullable, + values: values, + extensions: extensions, + ); + } +} + +// anyOf +final class JsonSumType extends JsonTypeSchema { + JsonSumType({ + required super.isNullable, + required this.types, + super.extensions, + }) : assert(types.isNotEmpty, 'Must have at least one type'); + + final List types; + + @override + JsonSumType withNullability(bool isNullable) { + return JsonSumType( + isNullable: isNullable, + types: types, + extensions: extensions, + ); + } +} + +// allOf +final class JsonProductType extends JsonTypeSchema { + JsonProductType({ + required super.isNullable, + required this.types, + super.extensions, + }) : assert(types.isNotEmpty, 'Must have at least one type'); + + final List types; + + @override + JsonProductType withNullability(bool isNullable) { + return JsonProductType( + isNullable: isNullable, + types: types, + extensions: extensions, + ); + } +} + +// oneOf +final class JsonSealedType extends JsonTypeSchema { + JsonSealedType({ + required super.isNullable, + required this.types, + super.extensions, + }) : assert(types.isNotEmpty, 'Must have at least one type'); + + final List types; + + @override + JsonSealedType withNullability(bool isNullable) { + return JsonSealedType( + isNullable: isNullable, + types: types, + extensions: extensions, + ); + } +} diff --git a/apps/cli/test/openapi/fixtures/bookstore_v3.json b/apps/cli/test/openapi/fixtures/bookstore_v3.json new file mode 100644 index 000000000..a9ce814c6 --- /dev/null +++ b/apps/cli/test/openapi/fixtures/bookstore_v3.json @@ -0,0 +1,392 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Bookstore", + "description": "A simple Bookstore API example.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://generated-bookstore.appspot.com/" + } + ], + "paths": { + "/shelves": { + "get": { + "description": "Return all shelves in the bookstore.", + "operationId": "listShelves", + "responses": { + "200": { + "description": "List of shelves in the bookstore.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/listShelvesResponse" + } + } + } + } + } + }, + "post": { + "description": "Create a new shelf in the bookstore.", + "operationId": "createShelf", + "requestBody": { + "description": "A shelf resource to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/shelf" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A newly created shelf resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/shelf" + } + } + } + } + } + }, + "delete": { + "description": "Delete all shelves.", + "operationId": "deleteShelves", + "responses": { + "default": { + "description": "An empty response body." + } + } + } + }, + "/shelves/{shelf}": { + "get": { + "description": "Get a single shelf resource with the given ID.", + "operationId": "getShelf", + "parameters": [ + { + "name": "shelf", + "in": "path", + "description": "ID of the shelf to get.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "default": { + "description": "unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + } + }, + "200": { + "description": "A shelf resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/shelf" + } + } + } + } + } + }, + "delete": { + "description": "Delete a single shelf with the given ID.", + "operationId": "deleteShelf", + "parameters": [ + { + "name": "shelf", + "in": "path", + "description": "ID of the shelf to delete.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "default": { + "description": "An empty response body." + } + } + } + }, + "/shelves/{shelf}/books": { + "get": { + "description": "Return all books in a shelf with the given ID.", + "operationId": "listBooks", + "parameters": [ + { + "name": "shelf", + "in": "path", + "description": "ID of the shelf whose books should be returned.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "default": { + "description": "unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + } + }, + "200": { + "description": "List of books on the specified shelf.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/listBooksResponse" + } + } + } + } + } + }, + "post": { + "description": "Create a new book on the shelf.", + "operationId": "createBook", + "parameters": [ + { + "name": "shelf", + "in": "path", + "description": "ID of the shelf where the book should be created.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "Book to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/book" + } + } + }, + "required": true + }, + "responses": { + "default": { + "description": "unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + } + }, + "200": { + "description": "A newly created book resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/book" + } + } + } + } + } + } + }, + "/shelves/{shelf}/books/{book}": { + "get": { + "description": "Get a single book with a given ID from a shelf.", + "operationId": "getBook", + "parameters": [ + { + "name": "shelf", + "in": "path", + "description": "ID of the shelf from which to get the book.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "book", + "in": "path", + "description": "ID of the book to get from the shelf.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "default": { + "description": "unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + } + }, + "200": { + "description": "A book resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/book" + } + } + } + } + } + }, + "delete": { + "description": "Delete a single book with a given ID from a shelf.", + "operationId": "deleteBook", + "parameters": [ + { + "name": "shelf", + "in": "path", + "description": "ID of the shelf from which to delete the book.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "book", + "in": "path", + "description": "ID of the book to delete from the shelf.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "default": { + "description": "An empty response body." + } + } + } + } + }, + "components": { + "schemas": { + "book": { + "required": [ + "name", + "author", + "title" + ], + "type": "object", + "properties": { + "author": { + "type": "string" + }, + "name": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "listBooksResponse": { + "required": [ + "books" + ], + "type": "object", + "properties": { + "books": { + "type": "array", + "items": { + "$ref": "#/components/schemas/book" + } + } + } + }, + "listShelvesResponse": { + "type": "object", + "properties": { + "shelves": { + "type": "array", + "items": { + "$ref": "#/components/schemas/shelf" + } + } + } + }, + "shelf": { + "required": [ + "name", + "theme" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "theme": { + "type": "string" + } + } + }, + "error": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "api_key": { + "type": "apiKey", + "name": "key", + "in": "query" + } + } + }, + "security": [ + { + "api_key": [ + ] + } + ] +} diff --git a/apps/cli/test/openapi/fixtures/bookstore_v3.spec b/apps/cli/test/openapi/fixtures/bookstore_v3.spec new file mode 100644 index 000000000..805545292 --- /dev/null +++ b/apps/cli/test/openapi/fixtures/bookstore_v3.spec @@ -0,0 +1,698 @@ +OpenApiDocument { + version=3.0.0, + info=OpenApiInfo { + title=Bookstore, + description=A simple Bookstore API example., + apiVersion=1.0.0, + ref=#/info, + node={title: Bookstore, description: A simple Bookstore API example., version: 1.0.0}, + }, + servers=[OpenApiServer { + url=https://generated-bookstore.appspot.com/, + variables={}, + ref=#/servers/0, + node={url: https://generated-bookstore.appspot.com/}, + }], + paths={/shelves: OpenApiComponentOrRef { + ref=#/paths//shelves, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[], + description=Return all shelves in the bookstore., + operationId=listShelves, + parameters=[], + responses={200: OpenApiComponentOrRef { + ref=#/paths//shelves/get/responses/200, + component=OpenApiResponse { + description=List of shelves in the bookstore., + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/listShelvesResponse, + name=listShelvesResponse, + node={$ref: #/components/schemas/listShelvesResponse}, + }, + node={$ref: #/components/schemas/listShelvesResponse}, + }, + encoding={}, + ref=#/paths//shelves/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/listShelvesResponse}}, + }}, + ref=#/paths//shelves/get/responses/200, + node={description: List of shelves in the bookstore., content: {application/json: {schema: {$ref: #/components/schemas/listShelvesResponse}}}}, + }, + }}, + }, post: OpenApiOperation { + type=post, + tags=[], + description=Create a new shelf in the bookstore., + operationId=createShelf, + parameters=[], + requestBody=OpenApiComponentOrRef { + ref=#/paths//shelves/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/shelf, + name=shelf, + node={$ref: #/components/schemas/shelf}, + }, + node={$ref: #/components/schemas/shelf}, + }, + encoding={}, + ref=#/paths//shelves/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/shelf}}, + }}, + description=A shelf resource to create., + required=true, + ref=#/paths//shelves/post/requestBody, + node={description: A shelf resource to create., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//shelves/post/responses/200, + component=OpenApiResponse { + description=A newly created shelf resource., + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/post/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/shelf, + name=shelf, + node={$ref: #/components/schemas/shelf}, + }, + node={$ref: #/components/schemas/shelf}, + }, + encoding={}, + ref=#/paths//shelves/post/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/shelf}}, + }}, + ref=#/paths//shelves/post/responses/200, + node={description: A newly created shelf resource., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}}, + }, + }}, + }, delete: OpenApiOperation { + type=delete, + tags=[], + description=Delete all shelves., + operationId=deleteShelves, + parameters=[], + responses={}, + defaultResponse=OpenApiComponentOrRef { + ref=#/paths//shelves/delete/responses/default, + component=OpenApiResponse { + description=An empty response body., + ref=#/paths//shelves/delete/responses/default, + node={description: An empty response body.}, + }, + }, + }}, + parameters=[], + ref=#/paths//shelves, + node={get: {description: Return all shelves in the bookstore., operationId: listShelves, responses: {200: {description: List of shelves in the bookstore., content: {application/json: {schema: {$ref: #/components/schemas/listShelvesResponse}}}}}}, post: {description: Create a new shelf in the bookstore., operationId: createShelf, requestBody: {description: A shelf resource to create., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}, required: true}, responses: {200: {description: A newly created shelf resource., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}}}}, delete: {description: Delete all shelves., operationId: deleteShelves, responses: {default: {description: An empty response body.}}}}, + }, + }, /shelves/{shelf}: OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[], + description=Get a single shelf resource with the given ID., + operationId=getShelf, + parameters=[OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/get/parameters/0, + component=OpenApiParameter { + name=shelf, + location=path, + description=ID of the shelf to get., + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/get/parameters/0/schema, + component=OpenApiSchema { + type=integer, + format=int64, + ref=#/paths//shelves/{shelf}/get/parameters/0/schema, + node={type: integer, format: int64}, + }, + }, + ref=#/paths//shelves/{shelf}/get/parameters/0, + node={name: shelf, in: path, description: ID of the shelf to get., required: true, schema: {type: integer, format: int64}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/get/responses/200, + component=OpenApiResponse { + description=A shelf resource., + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/shelf, + name=shelf, + node={$ref: #/components/schemas/shelf}, + }, + node={$ref: #/components/schemas/shelf}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/shelf}}, + }}, + ref=#/paths//shelves/{shelf}/get/responses/200, + node={description: A shelf resource., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}}, + }, + }}, + defaultResponse=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/get/responses/default, + component=OpenApiResponse { + description=unexpected error, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/get/responses/default/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/error, + name=error, + node={$ref: #/components/schemas/error}, + }, + node={$ref: #/components/schemas/error}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/get/responses/default/content/application/json, + node={schema: {$ref: #/components/schemas/error}}, + }}, + ref=#/paths//shelves/{shelf}/get/responses/default, + node={description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, + }, + }, + }, delete: OpenApiOperation { + type=delete, + tags=[], + description=Delete a single shelf with the given ID., + operationId=deleteShelf, + parameters=[OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/delete/parameters/0, + component=OpenApiParameter { + name=shelf, + location=path, + description=ID of the shelf to delete., + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/delete/parameters/0/schema, + component=OpenApiSchema { + type=integer, + format=int64, + ref=#/paths//shelves/{shelf}/delete/parameters/0/schema, + node={type: integer, format: int64}, + }, + }, + ref=#/paths//shelves/{shelf}/delete/parameters/0, + node={name: shelf, in: path, description: ID of the shelf to delete., required: true, schema: {type: integer, format: int64}}, + }, + }], + responses={}, + defaultResponse=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/delete/responses/default, + component=OpenApiResponse { + description=An empty response body., + ref=#/paths//shelves/{shelf}/delete/responses/default, + node={description: An empty response body.}, + }, + }, + }}, + parameters=[], + ref=#/paths//shelves/{shelf}, + node={get: {description: Get a single shelf resource with the given ID., operationId: getShelf, parameters: [{name: shelf, in: path, description: ID of the shelf to get., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, 200: {description: A shelf resource., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}}}}, delete: {description: Delete a single shelf with the given ID., operationId: deleteShelf, parameters: [{name: shelf, in: path, description: ID of the shelf to delete., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: An empty response body.}}}}, + }, + }, /shelves/{shelf}/books: OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[], + description=Return all books in a shelf with the given ID., + operationId=listBooks, + parameters=[OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/get/parameters/0, + component=OpenApiParameter { + name=shelf, + location=path, + description=ID of the shelf whose books should be returned., + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/get/parameters/0/schema, + component=OpenApiSchema { + type=integer, + format=int64, + ref=#/paths//shelves/{shelf}/books/get/parameters/0/schema, + node={type: integer, format: int64}, + }, + }, + ref=#/paths//shelves/{shelf}/books/get/parameters/0, + node={name: shelf, in: path, description: ID of the shelf whose books should be returned., required: true, schema: {type: integer, format: int64}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/get/responses/200, + component=OpenApiResponse { + description=List of books on the specified shelf., + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/listBooksResponse, + name=listBooksResponse, + node={$ref: #/components/schemas/listBooksResponse}, + }, + node={$ref: #/components/schemas/listBooksResponse}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/books/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/listBooksResponse}}, + }}, + ref=#/paths//shelves/{shelf}/books/get/responses/200, + node={description: List of books on the specified shelf., content: {application/json: {schema: {$ref: #/components/schemas/listBooksResponse}}}}, + }, + }}, + defaultResponse=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/get/responses/default, + component=OpenApiResponse { + description=unexpected error, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/get/responses/default/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/error, + name=error, + node={$ref: #/components/schemas/error}, + }, + node={$ref: #/components/schemas/error}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/books/get/responses/default/content/application/json, + node={schema: {$ref: #/components/schemas/error}}, + }}, + ref=#/paths//shelves/{shelf}/books/get/responses/default, + node={description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, + }, + }, + }, post: OpenApiOperation { + type=post, + tags=[], + description=Create a new book on the shelf., + operationId=createBook, + parameters=[OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/post/parameters/0, + component=OpenApiParameter { + name=shelf, + location=path, + description=ID of the shelf where the book should be created., + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/post/parameters/0/schema, + component=OpenApiSchema { + type=integer, + format=int64, + ref=#/paths//shelves/{shelf}/books/post/parameters/0/schema, + node={type: integer, format: int64}, + }, + }, + ref=#/paths//shelves/{shelf}/books/post/parameters/0, + node={name: shelf, in: path, description: ID of the shelf where the book should be created., required: true, schema: {type: integer, format: int64}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/book, + name=book, + node={$ref: #/components/schemas/book}, + }, + node={$ref: #/components/schemas/book}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/books/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/book}}, + }}, + description=Book to create., + required=true, + ref=#/paths//shelves/{shelf}/books/post/requestBody, + node={description: Book to create., content: {application/json: {schema: {$ref: #/components/schemas/book}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/post/responses/200, + component=OpenApiResponse { + description=A newly created book resource., + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/post/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/book, + name=book, + node={$ref: #/components/schemas/book}, + }, + node={$ref: #/components/schemas/book}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/books/post/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/book}}, + }}, + ref=#/paths//shelves/{shelf}/books/post/responses/200, + node={description: A newly created book resource., content: {application/json: {schema: {$ref: #/components/schemas/book}}}}, + }, + }}, + defaultResponse=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/post/responses/default, + component=OpenApiResponse { + description=unexpected error, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/post/responses/default/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/error, + name=error, + node={$ref: #/components/schemas/error}, + }, + node={$ref: #/components/schemas/error}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/books/post/responses/default/content/application/json, + node={schema: {$ref: #/components/schemas/error}}, + }}, + ref=#/paths//shelves/{shelf}/books/post/responses/default, + node={description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, + }, + }, + }}, + parameters=[], + ref=#/paths//shelves/{shelf}/books, + node={get: {description: Return all books in a shelf with the given ID., operationId: listBooks, parameters: [{name: shelf, in: path, description: ID of the shelf whose books should be returned., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, 200: {description: List of books on the specified shelf., content: {application/json: {schema: {$ref: #/components/schemas/listBooksResponse}}}}}}, post: {description: Create a new book on the shelf., operationId: createBook, parameters: [{name: shelf, in: path, description: ID of the shelf where the book should be created., required: true, schema: {type: integer, format: int64}}], requestBody: {description: Book to create., content: {application/json: {schema: {$ref: #/components/schemas/book}}}, required: true}, responses: {default: {description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, 200: {description: A newly created book resource., content: {application/json: {schema: {$ref: #/components/schemas/book}}}}}}}, + }, + }, /shelves/{shelf}/books/{book}: OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[], + description=Get a single book with a given ID from a shelf., + operationId=getBook, + parameters=[OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/get/parameters/0, + component=OpenApiParameter { + name=shelf, + location=path, + description=ID of the shelf from which to get the book., + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/get/parameters/0/schema, + component=OpenApiSchema { + type=integer, + format=int64, + ref=#/paths//shelves/{shelf}/books/{book}/get/parameters/0/schema, + node={type: integer, format: int64}, + }, + }, + ref=#/paths//shelves/{shelf}/books/{book}/get/parameters/0, + node={name: shelf, in: path, description: ID of the shelf from which to get the book., required: true, schema: {type: integer, format: int64}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/get/parameters/1, + component=OpenApiParameter { + name=book, + location=path, + description=ID of the book to get from the shelf., + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/get/parameters/1/schema, + component=OpenApiSchema { + type=integer, + format=int64, + ref=#/paths//shelves/{shelf}/books/{book}/get/parameters/1/schema, + node={type: integer, format: int64}, + }, + }, + ref=#/paths//shelves/{shelf}/books/{book}/get/parameters/1, + node={name: book, in: path, description: ID of the book to get from the shelf., required: true, schema: {type: integer, format: int64}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/get/responses/200, + component=OpenApiResponse { + description=A book resource., + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/book, + name=book, + node={$ref: #/components/schemas/book}, + }, + node={$ref: #/components/schemas/book}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/books/{book}/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/book}}, + }}, + ref=#/paths//shelves/{shelf}/books/{book}/get/responses/200, + node={description: A book resource., content: {application/json: {schema: {$ref: #/components/schemas/book}}}}, + }, + }}, + defaultResponse=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/get/responses/default, + component=OpenApiResponse { + description=unexpected error, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/get/responses/default/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/error, + name=error, + node={$ref: #/components/schemas/error}, + }, + node={$ref: #/components/schemas/error}, + }, + encoding={}, + ref=#/paths//shelves/{shelf}/books/{book}/get/responses/default/content/application/json, + node={schema: {$ref: #/components/schemas/error}}, + }}, + ref=#/paths//shelves/{shelf}/books/{book}/get/responses/default, + node={description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, + }, + }, + }, delete: OpenApiOperation { + type=delete, + tags=[], + description=Delete a single book with a given ID from a shelf., + operationId=deleteBook, + parameters=[OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/delete/parameters/0, + component=OpenApiParameter { + name=shelf, + location=path, + description=ID of the shelf from which to delete the book., + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/delete/parameters/0/schema, + component=OpenApiSchema { + type=integer, + format=int64, + ref=#/paths//shelves/{shelf}/books/{book}/delete/parameters/0/schema, + node={type: integer, format: int64}, + }, + }, + ref=#/paths//shelves/{shelf}/books/{book}/delete/parameters/0, + node={name: shelf, in: path, description: ID of the shelf from which to delete the book., required: true, schema: {type: integer, format: int64}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/delete/parameters/1, + component=OpenApiParameter { + name=book, + location=path, + description=ID of the book to delete from the shelf., + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/delete/parameters/1/schema, + component=OpenApiSchema { + type=integer, + format=int64, + ref=#/paths//shelves/{shelf}/books/{book}/delete/parameters/1/schema, + node={type: integer, format: int64}, + }, + }, + ref=#/paths//shelves/{shelf}/books/{book}/delete/parameters/1, + node={name: book, in: path, description: ID of the book to delete from the shelf., required: true, schema: {type: integer, format: int64}}, + }, + }], + responses={}, + defaultResponse=OpenApiComponentOrRef { + ref=#/paths//shelves/{shelf}/books/{book}/delete/responses/default, + component=OpenApiResponse { + description=An empty response body., + ref=#/paths//shelves/{shelf}/books/{book}/delete/responses/default, + node={description: An empty response body.}, + }, + }, + }}, + parameters=[], + ref=#/paths//shelves/{shelf}/books/{book}, + node={get: {description: Get a single book with a given ID from a shelf., operationId: getBook, parameters: [{name: shelf, in: path, description: ID of the shelf from which to get the book., required: true, schema: {type: integer, format: int64}}, {name: book, in: path, description: ID of the book to get from the shelf., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, 200: {description: A book resource., content: {application/json: {schema: {$ref: #/components/schemas/book}}}}}}, delete: {description: Delete a single book with a given ID from a shelf., operationId: deleteBook, parameters: [{name: shelf, in: path, description: ID of the shelf from which to delete the book., required: true, schema: {type: integer, format: int64}}, {name: book, in: path, description: ID of the book to delete from the shelf., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: An empty response body.}}}}, + }, + }}, + components=OpenApiComponents { + schemas={book: OpenApiSchema { + name=book, + type=object, + properties={author: OpenApiComponentOrRef { + ref=#/components/schemas/book/properties/author, + component=OpenApiSchema { + name=author, + type=string, + ref=#/components/schemas/book/properties/author, + node={type: string}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/book/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/book/properties/name, + node={type: string}, + }, + }, title: OpenApiComponentOrRef { + ref=#/components/schemas/book/properties/title, + component=OpenApiSchema { + name=title, + type=string, + ref=#/components/schemas/book/properties/title, + node={type: string}, + }, + }}, + required={name, author, title}, + ref=#/components/schemas/book, + node={required: [name, author, title], type: object, properties: {author: {type: string}, name: {type: string}, title: {type: string}}}, + }, listBooksResponse: OpenApiSchema { + name=listBooksResponse, + type=object, + properties={books: OpenApiComponentOrRef { + ref=#/components/schemas/listBooksResponse/properties/books, + component=OpenApiSchema { + name=books, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/listBooksResponse/properties/books/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/book, + name=book, + node={$ref: #/components/schemas/book}, + }, + node={$ref: #/components/schemas/book}, + }, + ref=#/components/schemas/listBooksResponse/properties/books, + node={type: array, items: {$ref: #/components/schemas/book}}, + }, + }}, + required={books}, + ref=#/components/schemas/listBooksResponse, + node={required: [books], type: object, properties: {books: {type: array, items: {$ref: #/components/schemas/book}}}}, + }, listShelvesResponse: OpenApiSchema { + name=listShelvesResponse, + type=object, + properties={shelves: OpenApiComponentOrRef { + ref=#/components/schemas/listShelvesResponse/properties/shelves, + component=OpenApiSchema { + name=shelves, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/listShelvesResponse/properties/shelves/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/shelf, + name=shelf, + node={$ref: #/components/schemas/shelf}, + }, + node={$ref: #/components/schemas/shelf}, + }, + ref=#/components/schemas/listShelvesResponse/properties/shelves, + node={type: array, items: {$ref: #/components/schemas/shelf}}, + }, + }}, + ref=#/components/schemas/listShelvesResponse, + node={type: object, properties: {shelves: {type: array, items: {$ref: #/components/schemas/shelf}}}}, + }, shelf: OpenApiSchema { + name=shelf, + type=object, + properties={name: OpenApiComponentOrRef { + ref=#/components/schemas/shelf/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/shelf/properties/name, + node={type: string}, + }, + }, theme: OpenApiComponentOrRef { + ref=#/components/schemas/shelf/properties/theme, + component=OpenApiSchema { + name=theme, + type=string, + ref=#/components/schemas/shelf/properties/theme, + node={type: string}, + }, + }}, + required={name, theme}, + ref=#/components/schemas/shelf, + node={required: [name, theme], type: object, properties: {name: {type: string}, theme: {type: string}}}, + }, error: OpenApiSchema { + name=error, + type=object, + properties={code: OpenApiComponentOrRef { + ref=#/components/schemas/error/properties/code, + component=OpenApiSchema { + name=code, + type=integer, + format=int32, + ref=#/components/schemas/error/properties/code, + node={type: integer, format: int32}, + }, + }, message: OpenApiComponentOrRef { + ref=#/components/schemas/error/properties/message, + component=OpenApiSchema { + name=message, + type=string, + ref=#/components/schemas/error/properties/message, + node={type: string}, + }, + }}, + required={code, message}, + ref=#/components/schemas/error, + node={required: [code, message], type: object, properties: {code: {type: integer, format: int32}, message: {type: string}}}, + }}, + responses={}, + parameters={}, + requestBodies={}, + headers={}, + securitySchemes={api_key: OpenApiSecurityScheme { + type=apiKey, + name=key, + location=query, + ref=#/components/securitySchemes/api_key, + node={type: apiKey, name: key, in: query}, + }}, + paths={}, + ref=#/components, + node={schemas: {book: {required: [name, author, title], type: object, properties: {author: {type: string}, name: {type: string}, title: {type: string}}}, listBooksResponse: {required: [books], type: object, properties: {books: {type: array, items: {$ref: #/components/schemas/book}}}}, listShelvesResponse: {type: object, properties: {shelves: {type: array, items: {$ref: #/components/schemas/shelf}}}}, shelf: {required: [name, theme], type: object, properties: {name: {type: string}, theme: {type: string}}}, error: {required: [code, message], type: object, properties: {code: {type: integer, format: int32}, message: {type: string}}}}, securitySchemes: {api_key: {type: apiKey, name: key, in: query}}}, + }, + securityRequirements=[OpenApiSecurityRequirement { + schemes={api_key: []}, + ref=#/security/0, + node={api_key: []}, + }], + tags=[], + ref=#, + node={openapi: 3.0.0, info: {title: Bookstore, description: A simple Bookstore API example., version: 1.0.0}, servers: [{url: https://generated-bookstore.appspot.com/}], paths: {/shelves: {get: {description: Return all shelves in the bookstore., operationId: listShelves, responses: {200: {description: List of shelves in the bookstore., content: {application/json: {schema: {$ref: #/components/schemas/listShelvesResponse}}}}}}, post: {description: Create a new shelf in the bookstore., operationId: createShelf, requestBody: {description: A shelf resource to create., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}, required: true}, responses: {200: {description: A newly created shelf resource., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}}}}, delete: {description: Delete all shelves., operationId: deleteShelves, responses: {default: {description: An empty response body.}}}}, /shelves/{shelf}: {get: {description: Get a single shelf resource with the given ID., operationId: getShelf, parameters: [{name: shelf, in: path, description: ID of the shelf to get., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, 200: {description: A shelf resource., content: {application/json: {schema: {$ref: #/components/schemas/shelf}}}}}}, delete: {description: Delete a single shelf with the given ID., operationId: deleteShelf, parameters: [{name: shelf, in: path, description: ID of the shelf to delete., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: An empty response body.}}}}, /shelves/{shelf}/books: {get: {description: Return all books in a shelf with the given ID., operationId: listBooks, parameters: [{name: shelf, in: path, description: ID of the shelf whose books should be returned., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, 200: {description: List of books on the specified shelf., content: {application/json: {schema: {$ref: #/components/schemas/listBooksResponse}}}}}}, post: {description: Create a new book on the shelf., operationId: createBook, parameters: [{name: shelf, in: path, description: ID of the shelf where the book should be created., required: true, schema: {type: integer, format: int64}}], requestBody: {description: Book to create., content: {application/json: {schema: {$ref: #/components/schemas/book}}}, required: true}, responses: {default: {description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, 200: {description: A newly created book resource., content: {application/json: {schema: {$ref: #/components/schemas/book}}}}}}}, /shelves/{shelf}/books/{book}: {get: {description: Get a single book with a given ID from a shelf., operationId: getBook, parameters: [{name: shelf, in: path, description: ID of the shelf from which to get the book., required: true, schema: {type: integer, format: int64}}, {name: book, in: path, description: ID of the book to get from the shelf., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: unexpected error, content: {application/json: {schema: {$ref: #/components/schemas/error}}}}, 200: {description: A book resource., content: {application/json: {schema: {$ref: #/components/schemas/book}}}}}}, delete: {description: Delete a single book with a given ID from a shelf., operationId: deleteBook, parameters: [{name: shelf, in: path, description: ID of the shelf from which to delete the book., required: true, schema: {type: integer, format: int64}}, {name: book, in: path, description: ID of the book to delete from the shelf., required: true, schema: {type: integer, format: int64}}], responses: {default: {description: An empty response body.}}}}}, components: {schemas: {book: {required: [name, author, title], type: object, properties: {author: {type: string}, name: {type: string}, title: {type: string}}}, listBooksResponse: {required: [books], type: object, properties: {books: {type: array, items: {$ref: #/components/schemas/book}}}}, listShelvesResponse: {type: object, properties: {shelves: {type: array, items: {$ref: #/components/schemas/shelf}}}}, shelf: {required: [name, theme], type: object, properties: {name: {type: string}, theme: {type: string}}}, error: {required: [code, message], type: object, properties: {code: {type: integer, format: int32}, message: {type: string}}}}, securitySchemes: {api_key: {type: apiKey, name: key, in: query}}}, security: [{api_key: []}]}, +} \ No newline at end of file diff --git a/apps/cli/test/openapi/fixtures/bookstore_v3.yaml b/apps/cli/test/openapi/fixtures/bookstore_v3.yaml new file mode 100644 index 000000000..eee460c7e --- /dev/null +++ b/apps/cli/test/openapi/fixtures/bookstore_v3.yaml @@ -0,0 +1,282 @@ +openapi: '3.0.0' +info: + title: Bookstore + description: |- + A simple Bookstore API example. + version: '1.0.0' +servers: + - url: https://generated-bookstore.appspot.com/ +paths: + '/shelves': + get: + description: |- + Return all shelves in the bookstore. + operationId: listShelves + responses: + '200': + description: |- + List of shelves in the bookstore. + content: + application/json: + schema: + $ref: '#/components/schemas/listShelvesResponse' + post: + description: |- + Create a new shelf in the bookstore. + operationId: createShelf + requestBody: + description: |- + A shelf resource to create. + content: + application/json: + schema: + $ref: '#/components/schemas/shelf' + required: true + responses: + '200': + description: |- + A newly created shelf resource. + content: + application/json: + schema: + $ref: '#/components/schemas/shelf' + delete: + description: |- + Delete all shelves. + operationId: deleteShelves + responses: + default: + description: |- + An empty response body. + '/shelves/{shelf}': + get: + description: |- + Get a single shelf resource with the given ID. + operationId: getShelf + parameters: + - name: shelf + in: path + required: true + description: |- + ID of the shelf to get. + schema: + type: integer + format: int64 + responses: + '200': + description: |- + A shelf resource. + content: + application/json: + schema: + $ref: '#/components/schemas/shelf' + default: + description: |- + unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + delete: + description: |- + Delete a single shelf with the given ID. + operationId: deleteShelf + parameters: + - name: shelf + in: path + required: true + description: |- + ID of the shelf to delete. + schema: + type: integer + format: int64 + responses: + default: + description: |- + An empty response body. + '/shelves/{shelf}/books': + get: + description: |- + Return all books in a shelf with the given ID. + operationId: listBooks + parameters: + - name: shelf + in: path + required: true + description: |- + ID of the shelf whose books should be returned. + schema: + type: integer + format: int64 + responses: + '200': + description: |- + List of books on the specified shelf. + content: + application/json: + schema: + $ref: '#/components/schemas/listBooksResponse' + default: + description: |- + unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + post: + description: |- + Create a new book on the shelf. + operationId: createBook + parameters: + - name: shelf + in: path + required: true + description: |- + ID of the shelf where the book should be created. + schema: + type: integer + format: int64 + requestBody: + description: |- + Book to create. + content: + application/json: + schema: + $ref: '#/components/schemas/book' + required: true + responses: + '200': + description: |- + A newly created book resource. + content: + application/json: + schema: + $ref: '#/components/schemas/book' + default: + description: |- + unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '/shelves/{shelf}/books/{book}': + get: + description: |- + Get a single book with a given ID from a shelf. + operationId: getBook + parameters: + - name: shelf + in: path + required: true + description: |- + ID of the shelf from which to get the book. + schema: + type: integer + format: int64 + - name: book + in: path + required: true + description: |- + ID of the book to get from the shelf. + schema: + type: integer + format: int64 + responses: + '200': + description: |- + A book resource. + content: + application/json: + schema: + $ref: '#/components/schemas/book' + default: + description: |- + unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/error' + delete: + description: |- + Delete a single book with a given ID from a shelf. + operationId: deleteBook + parameters: + - name: shelf + in: path + required: true + description: |- + ID of the shelf from which to delete the book. + schema: + type: integer + format: int64 + - name: book + in: path + required: true + description: |- + ID of the book to delete from the shelf. + schema: + type: integer + format: int64 + responses: + default: + description: |- + An empty response body. +components: + schemas: + book: + type: object + properties: + author: + type: string + name: + type: string + title: + type: string + required: + - name + - author + - title + listBooksResponse: + type: object + properties: + books: + type: array + items: + $ref: '#/components/schemas/book' + required: + - books + listShelvesResponse: + type: object + properties: + shelves: + type: array + items: + $ref: '#/components/schemas/shelf' + shelf: + type: object + properties: + name: + type: string + theme: + type: string + required: + - name + - theme + error: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + required: + - code + - message + securitySchemes: + api_key: + type: apiKey + name: key + in: query +security: + - api_key: [] diff --git a/apps/cli/test/openapi/fixtures/fly_api.json b/apps/cli/test/openapi/fixtures/fly_api.json new file mode 100644 index 000000000..c44e51a56 --- /dev/null +++ b/apps/cli/test/openapi/fixtures/fly_api.json @@ -0,0 +1,3679 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Machines API", + "description": "This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/) for how to get started, more information about each endpoint, parameter descriptions, and examples.", + "contact": {}, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "1.0" + }, + "externalDocs": { + "url": "https://fly.io/docs/machines/working-with-machines/" + }, + "servers": [ + { + "url": "https://api.machines.dev/v1" + } + ], + "tags": [ + { + "name": "Apps", + "description": "This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource." + }, + { + "name": "Machines", + "description": "This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/machines-resource/) for details about using the Machines resource." + }, + { + "name": "Volumes", + "description": "This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/volumes-resource/) for details about using the Volumes resource." + } + ], + "paths": { + "/apps": { + "get": { + "tags": [ + "Apps" + ], + "summary": "List Apps", + "description": "List all apps with the ability to filter by organization slug.\n", + "operationId": "Apps_list", + "parameters": [ + { + "name": "org_slug", + "in": "query", + "description": "The org slug, or 'personal', to filter apps", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListAppsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Apps" + ], + "summary": "Create App", + "description": "Create an app with the specified details in the request body.\n", + "operationId": "Apps_create", + "requestBody": { + "description": "App body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateAppRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + }, + "/apps/{app_name}": { + "get": { + "tags": [ + "Apps" + ], + "summary": "Get App", + "description": "Retrieve details about a specific app by its name.\n", + "operationId": "Apps_show", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/App" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Apps" + ], + "summary": "Destroy App", + "description": "Delete an app by its name.\n", + "operationId": "Apps_delete", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "202": { + "description": "Accepted", + "content": {} + } + } + } + }, + "/apps/{app_name}/machines": { + "get": { + "tags": [ + "Machines" + ], + "summary": "List Machines", + "description": "List all Machines associated with a specific app, with optional filters for including deleted Machines and filtering by region.\n", + "operationId": "Machines_list", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "include_deleted", + "in": "query", + "description": "Include deleted machines", + "schema": { + "type": "boolean" + } + }, + { + "name": "region", + "in": "query", + "description": "Region filter", + "schema": { + "type": "string" + } + }, + { + "name": "state", + "in": "query", + "description": "comma separated list of states to filter (created, started, stopped, suspended)", + "schema": { + "type": "string" + } + }, + { + "name": "summary", + "in": "query", + "description": "Only return summary info about machines (omit config, checks, events, host_status, nonce, etc.)", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Machine" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Machines" + ], + "summary": "Create Machine", + "description": "Create a Machine within a specific app using the details provided in the request body.\n\n**Important**: This request can fail, and you’re responsible for handling that failure. If you ask for a large Machine, or a Machine in a region we happen to be at capacity for, you might need to retry the request, or to fall back to another region. If you’re working directly with the Machines API, you’re taking some responsibility for your own orchestration!\n", + "operationId": "Machines_create", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Create machine request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMachineRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Machine" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + }, + "/apps/{app_name}/machines/{machine_id}": { + "get": { + "tags": [ + "Machines" + ], + "summary": "Get Machine", + "description": "Get details of a specific Machine within an app by the Machine ID.\n", + "operationId": "Machines_show", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Machine" + } + } + } + } + } + }, + "post": { + "tags": [ + "Machines" + ], + "summary": "Update Machine", + "description": "Update a Machine's configuration using the details provided in the request body.\n", + "operationId": "Machines_update", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMachineRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Machine" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + }, + "delete": { + "tags": [ + "Machines" + ], + "summary": "Destroy Machine", + "description": "Delete a specific Machine within an app by Machine ID, with an optional force parameter to force kill the Machine if it's running.\n", + "operationId": "Machines_delete", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force kill the machine if it's running", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/cordon": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Cordon Machine", + "description": "“Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones.\n", + "operationId": "Machines_cordon", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/events": { + "get": { + "tags": [ + "Machines" + ], + "summary": "List Events", + "description": "List all events associated with a specific Machine within an app.\n", + "operationId": "Machines_list_events", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MachineEvent" + } + } + } + } + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/exec": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Execute Command", + "description": "Execute a command on a specific Machine and return the raw command output bytes.\n", + "operationId": "Machines_exec", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MachineExecRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "stdout, stderr, exit code, and exit signal are returned", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/flydv1.ExecResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/flydv1.ExecResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + }, + "/apps/{app_name}/machines/{machine_id}/lease": { + "get": { + "tags": [ + "Machines" + ], + "summary": "Get Lease", + "description": "Retrieve the current lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine.\n", + "operationId": "Machines_show_lease", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Lease" + } + } + } + } + } + }, + "post": { + "tags": [ + "Machines" + ], + "summary": "Create Lease", + "description": "Create a lease for a specific Machine within an app using the details provided in the request body. Machine leases can be used to obtain an exclusive lock on modifying a Machine.\n", + "operationId": "Machines_create_lease", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "fly-machine-lease-nonce", + "in": "header", + "description": "Existing lease nonce to refresh by ttl, empty or non-existent to create a new lease", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLeaseRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Lease" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + }, + "delete": { + "tags": [ + "Machines" + ], + "summary": "Release Lease", + "description": "Release the lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine.\n", + "operationId": "Machines_release_lease", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "fly-machine-lease-nonce", + "in": "header", + "description": "Existing lease nonce", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/metadata": { + "get": { + "tags": [ + "Machines" + ], + "summary": "Get Metadata", + "description": "Retrieve metadata for a specific Machine within an app.\n", + "operationId": "Machines_show_metadata", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/metadata/{key}": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Update Metadata", + "description": "Update metadata for a specific machine within an app by providing a metadata key.\n", + "operationId": "Machines_update_metadata", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "key", + "in": "path", + "description": "Metadata Key", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Machines" + ], + "summary": "Delete Metadata", + "description": "Delete metadata for a specific Machine within an app by providing a metadata key.\n", + "operationId": "Machines_delete_metadata", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "key", + "in": "path", + "description": "Metadata Key", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content", + "content": {} + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/ps": { + "get": { + "tags": [ + "Machines" + ], + "summary": "List Processes", + "description": "List all processes running on a specific Machine within an app, with optional sorting parameters.\n", + "operationId": "Machines_list_processes", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "sort_by", + "in": "query", + "description": "Sort by", + "schema": { + "type": "string" + } + }, + { + "name": "order", + "in": "query", + "description": "Order", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessStat" + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/restart": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Restart Machine", + "description": "Restart a specific Machine within an app, with an optional timeout parameter.\n", + "operationId": "Machines_restart", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Restart timeout as a Go duration string or number of seconds", + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Unix signal name", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/signal": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Signal Machine", + "description": "Send a signal to a specific Machine within an app using the details provided in the request body.\n", + "operationId": "Machines_signal", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignalRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + }, + "/apps/{app_name}/machines/{machine_id}/start": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Start Machine", + "description": "Start a specific Machine within an app.\n", + "operationId": "Machines_start", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/stop": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Stop Machine", + "description": "Stop a specific Machine within an app, with an optional request body to specify signal and timeout.\n", + "operationId": "Machines_stop", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Optional request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StopRequest" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "OK", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + }, + "/apps/{app_name}/machines/{machine_id}/suspend": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Suspend Machine", + "description": "Suspend a specific Machine within an app. The next start operation will attempt (but is not guaranteed) to resume the Machine from a snapshot taken at suspension time, rather than performing a cold boot.\n", + "operationId": "Machines_suspend", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/uncordon": { + "post": { + "tags": [ + "Machines" + ], + "summary": "Uncordon Machine", + "description": "“Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones.\n", + "operationId": "Machines_uncordon", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/versions": { + "get": { + "tags": [ + "Machines" + ], + "summary": "List Versions", + "description": "List all versions of the configuration for a specific Machine within an app.\n", + "operationId": "Machines_list_versions", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MachineVersion" + } + } + } + } + } + } + } + }, + "/apps/{app_name}/machines/{machine_id}/wait": { + "get": { + "tags": [ + "Machines" + ], + "summary": "Wait for State", + "description": "Wait for a Machine to reach a specific state. Specify the desired state with the state parameter. See the [Machine states table](https://fly.io/docs/machines/working-with-machines/#machine-states) for a list of possible states. The default for this parameter is `started`.\n\nThis request will block for up to 60 seconds. Set a shorter timeout with the timeout parameter.\n", + "operationId": "Machines_wait", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "machine_id", + "in": "path", + "description": "Machine ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "instance_id", + "in": "query", + "description": "26-character Machine version ID", + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "wait timeout. default 60s", + "schema": { + "type": "integer" + } + }, + { + "name": "state", + "in": "query", + "description": "desired state", + "schema": { + "type": "string", + "enum": [ + "started", + "stopped", + "suspended", + "destroyed" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/apps/{app_name}/secrets": { + "get": { + "tags": [ + "Secrets" + ], + "summary": "List App secrets", + "operationId": "Secrets_list", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListSecret" + } + } + } + } + } + } + } + }, + "/apps/{app_name}/secrets/{secret_label}": { + "delete": { + "tags": [ + "Secrets" + ], + "summary": "Destroy Secret", + "operationId": "Secret_delete", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "secret_label", + "in": "path", + "description": "App Secret Label", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/apps/{app_name}/secrets/{secret_label}/type/{secret_type}": { + "post": { + "tags": [ + "Secrets" + ], + "summary": "Create Secret", + "operationId": "Secret_create", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "secret_label", + "in": "path", + "description": "App Secret Label", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "secret_type", + "in": "path", + "description": "App Secret Type", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "secret body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSecretRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + }, + "/apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate": { + "post": { + "tags": [ + "Secrets" + ], + "summary": "Generate Secret", + "operationId": "Secret_generate", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "secret_label", + "in": "path", + "description": "App Secret Label", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "secret_type", + "in": "path", + "description": "App Secret Type", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Created", + "content": {} + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/apps/{app_name}/volumes": { + "get": { + "tags": [ + "Volumes" + ], + "summary": "List Volumes", + "description": "List all volumes associated with a specific app.\n", + "operationId": "Volumes_list", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "summary", + "in": "query", + "description": "Only return summary info about volumes (omit blocks, block size, etc)", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Volumes" + ], + "summary": "Create Volume", + "description": "Create a volume for a specific app using the details provided in the request body.\n", + "operationId": "Volumes_create", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateVolumeRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + }, + "/apps/{app_name}/volumes/{volume_id}": { + "get": { + "tags": [ + "Volumes" + ], + "summary": "Get Volume", + "description": "Retrieve details about a specific volume by its ID within an app.\n", + "operationId": "Volumes_get_by_id", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "volume_id", + "in": "path", + "description": "Volume ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + } + } + }, + "put": { + "tags": [ + "Volumes" + ], + "summary": "Update Volume", + "description": "Update a volume's configuration using the details provided in the request body.\n", + "operationId": "Volumes_update", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "volume_id", + "in": "path", + "description": "Volume ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateVolumeRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + }, + "delete": { + "tags": [ + "Volumes" + ], + "summary": "Destroy Volume", + "description": "Delete a specific volume within an app by volume ID.\n", + "operationId": "Volume_delete", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "volume_id", + "in": "path", + "description": "Volume ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + } + } + } + }, + "/apps/{app_name}/volumes/{volume_id}/extend": { + "put": { + "tags": [ + "Volumes" + ], + "summary": "Extend Volume", + "description": "Extend a volume's size within an app using the details provided in the request body.\n", + "operationId": "Volumes_extend", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "volume_id", + "in": "path", + "description": "Volume ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtendVolumeRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtendVolumeResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + }, + "/apps/{app_name}/volumes/{volume_id}/snapshots": { + "get": { + "tags": [ + "Volumes" + ], + "summary": "List Snapshots", + "description": "List all snapshots for a specific volume within an app.\n", + "operationId": "Volumes_list_snapshots", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "volume_id", + "in": "path", + "description": "Volume ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VolumeSnapshot" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Volumes" + ], + "summary": "Create Snapshot", + "description": "Create a snapshot for a specific volume within an app.\n", + "operationId": "createVolumeSnapshot", + "parameters": [ + { + "name": "app_name", + "in": "path", + "description": "Fly App Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "volume_id", + "in": "path", + "description": "Volume ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/tokens/kms": { + "post": { + "tags": [ + "Tokens" + ], + "summary": "Request a Petsem token for accessing KMS", + "description": "This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource.", + "operationId": "Tokens_request_Kms", + "responses": { + "200": { + "description": "KMS token", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/tokens/oidc": { + "post": { + "tags": [ + "Tokens" + ], + "summary": "Request an OIDC token", + "description": "Request an Open ID Connect token for your machine. Customize the audience claim with the `aud` parameter. This returns a JWT token. Learn more about [using OpenID Connect](/docs/reference/openid-connect/) on Fly.io.\n", + "operationId": "Tokens_request_OIDC", + "requestBody": { + "description": "Optional request body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOIDCTokenRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OIDC token", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "request" + } + } + }, + "components": { + "schemas": { + "App": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "status": { + "type": "string" + } + } + }, + "CheckStatus": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "output": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "CreateAppRequest": { + "type": "object", + "properties": { + "app_name": { + "type": "string" + }, + "enable_subdomains": { + "type": "boolean" + }, + "network": { + "type": "string" + }, + "org_slug": { + "type": "string" + } + } + }, + "CreateLeaseRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "ttl": { + "type": "integer", + "description": "seconds lease will be valid" + } + } + }, + "CreateMachineRequest": { + "type": "object", + "properties": { + "config": { + "type": "object", + "description": "An object defining the Machine configuration", + "allOf": [ + { + "$ref": "#/components/schemas/fly.MachineConfig" + } + ] + }, + "lease_ttl": { + "type": "integer" + }, + "lsvd": { + "type": "boolean" + }, + "name": { + "type": "string", + "description": "Unique name for this Machine. If omitted, one is generated for you" + }, + "region": { + "type": "string", + "description": "The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you)." + }, + "skip_launch": { + "type": "boolean" + }, + "skip_service_registration": { + "type": "boolean" + } + } + }, + "CreateOIDCTokenRequest": { + "type": "object", + "properties": { + "aud": { + "type": "string", + "example": "https://fly.io/org-slug" + }, + "aws_principal_tags": { + "type": "boolean" + } + }, + "description": "Optional parameters" + }, + "CreateSecretRequest": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "CreateVolumeRequest": { + "type": "object", + "properties": { + "compute": { + "$ref": "#/components/schemas/fly.MachineGuest" + }, + "compute_image": { + "type": "string" + }, + "encrypted": { + "type": "boolean" + }, + "fstype": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "require_unique_zone": { + "type": "boolean" + }, + "size_gb": { + "type": "integer" + }, + "snapshot_id": { + "type": "string", + "description": "restore from snapshot" + }, + "snapshot_retention": { + "type": "integer" + }, + "source_volume_id": { + "type": "string", + "description": "fork from remote volume" + }, + "unique_zone_app_wide": { + "type": "boolean" + } + } + }, + "ErrorResponse": { + "type": "object", + "properties": { + "details": { + "type": "object", + "description": "Deprecated" + }, + "error": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/main.statusCode" + } + } + }, + "ExtendVolumeRequest": { + "type": "object", + "properties": { + "size_gb": { + "type": "integer" + } + } + }, + "ExtendVolumeResponse": { + "type": "object", + "properties": { + "needs_restart": { + "type": "boolean" + }, + "volume": { + "$ref": "#/components/schemas/Volume" + } + } + }, + "ImageRef": { + "type": "object", + "properties": { + "digest": { + "type": "string" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "registry": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "Lease": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Description or reason for the Lease." + }, + "expires_at": { + "type": "integer", + "description": "ExpiresAt is the unix timestamp in UTC to denote when the Lease will no longer be valid." + }, + "nonce": { + "type": "string", + "description": "Nonce is the unique ID autogenerated and associated with the Lease." + }, + "owner": { + "type": "string", + "description": "Owner is the user identifier which acquired the Lease." + }, + "version": { + "type": "string", + "description": "Machine version" + } + } + }, + "ListApp": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "machine_count": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "network": { + "type": "object" + } + } + }, + "ListAppsResponse": { + "type": "object", + "properties": { + "apps": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListApp" + } + }, + "total_apps": { + "type": "integer" + } + } + }, + "ListSecret": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "publickey": { + "type": "array", + "items": { + "type": "integer" + } + }, + "type": { + "type": "string" + } + } + }, + "ListenSocket": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "proto": { + "type": "string" + } + } + }, + "Machine": { + "type": "object", + "properties": { + "checks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CheckStatus" + } + }, + "config": { + "$ref": "#/components/schemas/fly.MachineConfig" + }, + "created_at": { + "type": "string" + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MachineEvent" + } + }, + "host_status": { + "type": "string", + "enum": [ + "ok", + "unknown", + "unreachable" + ] + }, + "id": { + "type": "string" + }, + "image_ref": { + "$ref": "#/components/schemas/ImageRef" + }, + "incomplete_config": { + "$ref": "#/components/schemas/fly.MachineConfig" + }, + "instance_id": { + "type": "string", + "description": "InstanceID is unique for each version of the machine" + }, + "name": { + "type": "string" + }, + "nonce": { + "type": "string", + "description": "Nonce is only every returned on machine creation if a lease_duration was provided." + }, + "private_ip": { + "type": "string", + "description": "PrivateIP is the internal 6PN address of the machine." + }, + "region": { + "type": "string" + }, + "state": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "MachineEvent": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "request": { + "type": "object" + }, + "source": { + "type": "string" + }, + "status": { + "type": "string" + }, + "timestamp": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "MachineExecRequest": { + "type": "object", + "properties": { + "cmd": { + "type": "string", + "description": "Deprecated: use Command instead" + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "container": { + "type": "string" + }, + "stdin": { + "type": "string" + }, + "timeout": { + "type": "integer" + } + } + }, + "MachineVersion": { + "type": "object", + "properties": { + "user_config": { + "$ref": "#/components/schemas/fly.MachineConfig" + }, + "version": { + "type": "string" + } + } + }, + "Organization": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "slug": { + "type": "string" + } + } + }, + "ProcessStat": { + "type": "object", + "properties": { + "command": { + "type": "string" + }, + "cpu": { + "type": "integer" + }, + "directory": { + "type": "string" + }, + "listen_sockets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListenSocket" + } + }, + "pid": { + "type": "integer" + }, + "rss": { + "type": "integer" + }, + "rtime": { + "type": "integer" + }, + "stime": { + "type": "integer" + } + } + }, + "SignalRequest": { + "type": "object", + "properties": { + "signal": { + "type": "string", + "enum": [ + "SIGABRT", + "SIGALRM", + "SIGFPE", + "SIGHUP", + "SIGILL", + "SIGINT", + "SIGKILL", + "SIGPIPE", + "SIGQUIT", + "SIGSEGV", + "SIGTERM", + "SIGTRAP", + "SIGUSR1" + ] + } + } + }, + "StopRequest": { + "type": "object", + "properties": { + "signal": { + "type": "string" + }, + "timeout": { + "$ref": "#/components/schemas/fly.Duration" + } + } + }, + "UpdateMachineRequest": { + "type": "object", + "properties": { + "config": { + "type": "object", + "description": "An object defining the Machine configuration", + "allOf": [ + { + "$ref": "#/components/schemas/fly.MachineConfig" + } + ] + }, + "current_version": { + "type": "string" + }, + "lease_ttl": { + "type": "integer" + }, + "lsvd": { + "type": "boolean" + }, + "name": { + "type": "string", + "description": "Unique name for this Machine. If omitted, one is generated for you" + }, + "region": { + "type": "string", + "description": "The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you)." + }, + "skip_launch": { + "type": "boolean" + }, + "skip_service_registration": { + "type": "boolean" + } + } + }, + "UpdateVolumeRequest": { + "type": "object", + "properties": { + "auto_backup_enabled": { + "type": "boolean" + }, + "snapshot_retention": { + "type": "integer" + } + } + }, + "Volume": { + "type": "object", + "properties": { + "attached_alloc_id": { + "type": "string" + }, + "attached_machine_id": { + "type": "string" + }, + "auto_backup_enabled": { + "type": "boolean" + }, + "block_size": { + "type": "integer" + }, + "blocks": { + "type": "integer" + }, + "blocks_avail": { + "type": "integer" + }, + "blocks_free": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "encrypted": { + "type": "boolean" + }, + "fstype": { + "type": "string" + }, + "host_status": { + "type": "string", + "enum": [ + "ok", + "unknown", + "unreachable" + ] + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "size_gb": { + "type": "integer" + }, + "snapshot_retention": { + "type": "integer" + }, + "state": { + "type": "string" + }, + "zone": { + "type": "string" + } + } + }, + "VolumeSnapshot": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "digest": { + "type": "string" + }, + "id": { + "type": "string" + }, + "retention_days": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "status": { + "type": "string" + } + } + }, + "fly.ContainerConfig": { + "type": "object", + "properties": { + "cmd": { + "type": "array", + "description": "CmdOverride is used to override the default command of the image.", + "items": { + "type": "string" + } + }, + "depends_on": { + "type": "array", + "description": "DependsOn can be used to define dependencies between containers. The container will only be\nstarted after all of its dependent conditions have been satisfied.", + "items": { + "$ref": "#/components/schemas/fly.ContainerDependency" + } + }, + "entrypoint": { + "type": "array", + "description": "EntrypointOverride is used to override the default entrypoint of the image.", + "items": { + "type": "string" + } + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "ExtraEnv is used to add additional environment variables to the container." + }, + "env_from": { + "type": "array", + "description": "EnvFrom can be provided to set environment variables from machine fields.", + "items": { + "$ref": "#/components/schemas/fly.EnvFrom" + } + }, + "exec": { + "type": "array", + "description": "Image Config overrides - these fields are used to override the image configuration.\nIf not provided, the image configuration will be used.\nExecOverride is used to override the default command of the image.", + "items": { + "type": "string" + } + }, + "files": { + "type": "array", + "description": "Files are files that will be written to the container file system.", + "items": { + "$ref": "#/components/schemas/fly.File" + } + }, + "healthchecks": { + "type": "array", + "description": "Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command.", + "items": { + "$ref": "#/components/schemas/fly.ContainerHealthcheck" + } + }, + "image": { + "type": "string", + "description": "Image is the docker image to run." + }, + "mounts": { + "type": "array", + "description": "Set of mounts added to the container. These must reference a volume in the machine config via its name.", + "items": { + "$ref": "#/components/schemas/fly.ContainerMount" + } + }, + "name": { + "type": "string", + "description": "Name is used to identify the container in the machine." + }, + "restart": { + "type": "object", + "description": "Restart is used to define the restart policy for the container. NOTE: spot-price is not\nsupported for containers.", + "allOf": [ + { + "$ref": "#/components/schemas/fly.MachineRestart" + } + ] + }, + "secrets": { + "type": "array", + "description": "Secrets can be provided at the process level to explicitly indicate which secrets should be\nused for the process. If not provided, the secrets provided at the machine level will be used.", + "items": { + "$ref": "#/components/schemas/fly.MachineSecret" + } + }, + "stop": { + "type": "object", + "description": "Stop is used to define the signal and timeout for stopping the container.", + "allOf": [ + { + "$ref": "#/components/schemas/fly.StopConfig" + } + ] + }, + "user": { + "type": "string", + "description": "UserOverride is used to override the default user of the image." + } + } + }, + "fly.ContainerDependency": { + "type": "object", + "properties": { + "condition": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/fly.ContainerDependencyCondition" + } + ] + }, + "name": { + "type": "string" + } + } + }, + "fly.ContainerDependencyCondition": { + "type": "string", + "enum": [ + "exited_successfully", + "healthy", + "started" + ], + "x-enum-varnames": [ + "ExitedSuccessfully", + "Healthy", + "Started" + ] + }, + "fly.ContainerHealthcheck": { + "type": "object", + "properties": { + "exec": { + "$ref": "#/components/schemas/fly.ExecHealthcheck" + }, + "failure_threshold": { + "type": "integer", + "description": "The number of times the check must fail before considering the container unhealthy." + }, + "grace_period": { + "type": "integer", + "description": "The time in seconds to wait after a container starts before checking its health." + }, + "http": { + "$ref": "#/components/schemas/fly.HTTPHealthcheck" + }, + "interval": { + "type": "integer", + "description": "The time in seconds between executing the defined check." + }, + "kind": { + "type": "object", + "description": "Kind of healthcheck (readiness, liveness)", + "allOf": [ + { + "$ref": "#/components/schemas/fly.ContainerHealthcheckKind" + } + ] + }, + "name": { + "type": "string", + "description": "The name of the check. Must be unique within the container." + }, + "success_threshold": { + "type": "integer", + "description": "The number of times the check must succeeed before considering the container healthy." + }, + "tcp": { + "$ref": "#/components/schemas/fly.TCPHealthcheck" + }, + "timeout": { + "type": "integer", + "description": "The time in seconds to wait for the check to complete." + }, + "unhealthy": { + "type": "object", + "description": "Unhealthy policy that determines what action to take if a container is deemed unhealthy", + "allOf": [ + { + "$ref": "#/components/schemas/fly.UnhealthyPolicy" + } + ] + } + } + }, + "fly.ContainerHealthcheckKind": { + "type": "string", + "enum": [ + "readiness", + "liveness" + ], + "x-enum-varnames": [ + "Readiness", + "Liveness" + ] + }, + "fly.ContainerHealthcheckScheme": { + "type": "string", + "enum": [ + "http", + "https" + ], + "x-enum-varnames": [ + "HTTP", + "HTTPS" + ] + }, + "fly.ContainerMount": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the volume. Must exist in the volumes field in the machine configuration" + }, + "path": { + "type": "string", + "description": "The path to mount the volume within the container" + } + } + }, + "fly.DNSConfig": { + "type": "object", + "properties": { + "dns_forward_rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.dnsForwardRule" + } + }, + "hostname": { + "type": "string" + }, + "hostname_fqdn": { + "type": "string" + }, + "nameservers": { + "type": "array", + "items": { + "type": "string" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.dnsOption" + } + }, + "searches": { + "type": "array", + "items": { + "type": "string" + } + }, + "skip_registration": { + "type": "boolean" + } + } + }, + "fly.Duration": { + "type": "object", + "properties": { + "time.Duration": { + "type": "integer", + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour", + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour", + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour" + ] + } + } + }, + "fly.EnvFrom": { + "type": "object", + "properties": { + "env_var": { + "type": "string", + "description": "EnvVar is required and is the name of the environment variable that will be set from the\nsecret. It must be a valid environment variable name." + }, + "field_ref": { + "type": "string", + "description": "FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image.", + "enum": [ + "id", + "version", + "app_name", + "private_ip", + "region", + "image" + ] + } + }, + "description": "EnvVar defines an environment variable to be populated from a machine field, env_var" + }, + "fly.ExecHealthcheck": { + "type": "object", + "properties": { + "command": { + "type": "array", + "description": "The command to run to check the health of the container (e.g. [\"cat\", \"/tmp/healthy\"])", + "items": { + "type": "string" + } + } + } + }, + "fly.File": { + "type": "object", + "properties": { + "guest_path": { + "type": "string", + "description": "GuestPath is the path on the machine where the file will be written and must be an absolute path.\nFor example: /full/path/to/file.json" + }, + "mode": { + "type": "integer", + "description": "Mode bits used to set permissions on this file as accepted by chmod(2)." + }, + "raw_value": { + "type": "string", + "description": "The base64 encoded string of the file contents." + }, + "secret_name": { + "type": "string", + "description": "The name of the secret that contains the base64 encoded file contents." + } + }, + "description": "A file that will be written to the Machine. One of RawValue or SecretName must be set." + }, + "fly.HTTPHealthcheck": { + "type": "object", + "properties": { + "headers": { + "type": "array", + "description": "Additional headers to send with the request", + "items": { + "$ref": "#/components/schemas/fly.MachineHTTPHeader" + } + }, + "method": { + "type": "string", + "description": "The HTTP method to use to when making the request" + }, + "path": { + "type": "string", + "description": "The path to send the request to" + }, + "port": { + "type": "integer", + "description": "The port to connect to, often the same as internal_port" + }, + "scheme": { + "type": "object", + "description": "Whether to use http or https", + "allOf": [ + { + "$ref": "#/components/schemas/fly.ContainerHealthcheckScheme" + } + ] + }, + "tls_server_name": { + "type": "string", + "description": "If the protocol is https, the hostname to use for TLS certificate validation" + }, + "tls_skip_verify": { + "type": "boolean", + "description": "If the protocol is https, whether or not to verify the TLS certificate" + } + } + }, + "fly.HTTPOptions": { + "type": "object", + "properties": { + "compress": { + "type": "boolean" + }, + "h2_backend": { + "type": "boolean" + }, + "headers_read_timeout": { + "type": "integer" + }, + "idle_timeout": { + "type": "integer" + }, + "response": { + "$ref": "#/components/schemas/fly.HTTPResponseOptions" + } + } + }, + "fly.HTTPResponseOptions": { + "type": "object", + "properties": { + "headers": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "pristine": { + "type": "boolean" + } + } + }, + "fly.MachineCheck": { + "type": "object", + "properties": { + "grace_period": { + "type": "object", + "description": "The time to wait after a VM starts before checking its health", + "allOf": [ + { + "$ref": "#/components/schemas/fly.Duration" + } + ] + }, + "headers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.MachineHTTPHeader" + } + }, + "interval": { + "type": "object", + "description": "The time between connectivity checks", + "allOf": [ + { + "$ref": "#/components/schemas/fly.Duration" + } + ] + }, + "kind": { + "type": "string", + "description": "Kind of the check (informational, readiness)", + "enum": [ + "informational", + "readiness" + ] + }, + "method": { + "type": "string", + "description": "For http checks, the HTTP method to use to when making the request" + }, + "path": { + "type": "string", + "description": "For http checks, the path to send the request to" + }, + "port": { + "type": "integer", + "description": "The port to connect to, often the same as internal_port" + }, + "protocol": { + "type": "string", + "description": "For http checks, whether to use http or https" + }, + "timeout": { + "type": "object", + "description": "The maximum time a connection can take before being reported as failing its health check", + "allOf": [ + { + "$ref": "#/components/schemas/fly.Duration" + } + ] + }, + "tls_server_name": { + "type": "string", + "description": "If the protocol is https, the hostname to use for TLS certificate validation" + }, + "tls_skip_verify": { + "type": "boolean", + "description": "For http checks with https protocol, whether or not to verify the TLS certificate" + }, + "type": { + "type": "string", + "description": "tcp or http" + } + }, + "description": "An optional object that defines one or more named checks. The key for each check is the check name." + }, + "fly.MachineConfig": { + "type": "object", + "properties": { + "auto_destroy": { + "type": "boolean", + "description": "Optional boolean telling the Machine to destroy itself once it’s complete (default false)" + }, + "checks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/fly.MachineCheck" + } + }, + "containers": { + "type": "array", + "description": "Containers are a list of containers that will run in the machine. Currently restricted to\nonly specific organizations.", + "items": { + "$ref": "#/components/schemas/fly.ContainerConfig" + } + }, + "disable_machine_autostart": { + "type": "boolean", + "description": "Deprecated: use Service.Autostart instead" + }, + "dns": { + "$ref": "#/components/schemas/fly.DNSConfig" + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "An object filled with key/value pairs to be set as environment variables" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.File" + } + }, + "guest": { + "$ref": "#/components/schemas/fly.MachineGuest" + }, + "image": { + "type": "string", + "description": "The docker image to run" + }, + "init": { + "$ref": "#/components/schemas/fly.MachineInit" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "metrics": { + "$ref": "#/components/schemas/fly.MachineMetrics" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.MachineMount" + } + }, + "processes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.MachineProcess" + } + }, + "restart": { + "$ref": "#/components/schemas/fly.MachineRestart" + }, + "schedule": { + "type": "string" + }, + "services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.MachineService" + } + }, + "size": { + "type": "string", + "description": "Deprecated: use Guest instead" + }, + "standbys": { + "type": "array", + "description": "Standbys enable a machine to be a standby for another. In the event of a hardware failure,\nthe standby machine will be started.", + "items": { + "type": "string" + } + }, + "statics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.Static" + } + }, + "stop_config": { + "$ref": "#/components/schemas/fly.StopConfig" + }, + "volumes": { + "type": "array", + "description": "Volumes describe the set of volumes that can be attached to the machine. Used in conjuction\nwith containers", + "items": { + "$ref": "#/components/schemas/fly.VolumeConfig" + } + } + } + }, + "fly.MachineGuest": { + "type": "object", + "properties": { + "cpu_kind": { + "type": "string" + }, + "cpus": { + "type": "integer" + }, + "gpu_kind": { + "type": "string" + }, + "gpus": { + "type": "integer" + }, + "host_dedication_id": { + "type": "string" + }, + "kernel_args": { + "type": "array", + "items": { + "type": "string" + } + }, + "memory_mb": { + "type": "integer" + } + } + }, + "fly.MachineHTTPHeader": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The header name" + }, + "values": { + "type": "array", + "description": "The header value", + "items": { + "type": "string" + } + } + }, + "description": "For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call." + }, + "fly.MachineInit": { + "type": "object", + "properties": { + "cmd": { + "type": "array", + "items": { + "type": "string" + } + }, + "entrypoint": { + "type": "array", + "items": { + "type": "string" + } + }, + "exec": { + "type": "array", + "items": { + "type": "string" + } + }, + "kernel_args": { + "type": "array", + "items": { + "type": "string" + } + }, + "swap_size_mb": { + "type": "integer" + }, + "tty": { + "type": "boolean" + } + } + }, + "fly.MachineMetrics": { + "type": "object", + "properties": { + "https": { + "type": "boolean" + }, + "path": { + "type": "string" + }, + "port": { + "type": "integer" + } + } + }, + "fly.MachineMount": { + "type": "object", + "properties": { + "add_size_gb": { + "type": "integer" + }, + "encrypted": { + "type": "boolean" + }, + "extend_threshold_percent": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "size_gb": { + "type": "integer" + }, + "size_gb_limit": { + "type": "integer" + }, + "volume": { + "type": "string" + } + } + }, + "fly.MachinePort": { + "type": "object", + "properties": { + "end_port": { + "type": "integer" + }, + "force_https": { + "type": "boolean" + }, + "handlers": { + "type": "array", + "items": { + "type": "string" + } + }, + "http_options": { + "$ref": "#/components/schemas/fly.HTTPOptions" + }, + "port": { + "type": "integer" + }, + "proxy_proto_options": { + "$ref": "#/components/schemas/fly.ProxyProtoOptions" + }, + "start_port": { + "type": "integer" + }, + "tls_options": { + "$ref": "#/components/schemas/fly.TLSOptions" + } + } + }, + "fly.MachineProcess": { + "type": "object", + "properties": { + "cmd": { + "type": "array", + "items": { + "type": "string" + } + }, + "entrypoint": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "env_from": { + "type": "array", + "description": "EnvFrom can be provided to set environment variables from machine fields.", + "items": { + "$ref": "#/components/schemas/fly.EnvFrom" + } + }, + "exec": { + "type": "array", + "items": { + "type": "string" + } + }, + "ignore_app_secrets": { + "type": "boolean", + "description": "IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to\nand only use the secrets provided at the process level. The default/legacy behavior is to use\nthe secrets provided at the App level." + }, + "secrets": { + "type": "array", + "description": "Secrets can be provided at the process level to explicitly indicate which secrets should be\nused for the process. If not provided, the secrets provided at the machine level will be used.", + "items": { + "$ref": "#/components/schemas/fly.MachineSecret" + } + }, + "user": { + "type": "string" + } + } + }, + "fly.MachineRestart": { + "type": "object", + "properties": { + "gpu_bid_price": { + "type": "number", + "description": "GPU bid price for spot Machines." + }, + "max_retries": { + "type": "integer", + "description": "When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop." + }, + "policy": { + "type": "string", + "description": "* no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash.\n* always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly.\n* on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules.\n* spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price.", + "enum": [ + "no", + "always", + "on-failure", + "spot-price" + ] + } + }, + "description": "The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/." + }, + "fly.MachineSecret": { + "type": "object", + "properties": { + "env_var": { + "type": "string", + "description": "EnvVar is required and is the name of the environment variable that will be set from the\nsecret. It must be a valid environment variable name." + }, + "name": { + "type": "string", + "description": "Name is optional and when provided is used to reference a secret name where the EnvVar is\ndifferent from what was set as the secret name." + } + }, + "description": "A Secret needing to be set in the environment of the Machine. env_var is required" + }, + "fly.MachineService": { + "type": "object", + "properties": { + "autostart": { + "type": "boolean" + }, + "autostop": { + "type": "string", + "description": "Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for \"off\" and \"stop\" in responses.\n* \"off\" or false - Do not autostop the Machine.\n* \"stop\" or true - Automatically stop the Machine.\n* \"suspend\" - Automatically suspend the Machine, falling back to a full stop if this is not possible.", + "enum": [ + "off", + "stop", + "suspend" + ] + }, + "checks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.MachineCheck" + } + }, + "concurrency": { + "$ref": "#/components/schemas/fly.MachineServiceConcurrency" + }, + "force_instance_description": { + "type": "string" + }, + "force_instance_key": { + "type": "string" + }, + "internal_port": { + "type": "integer" + }, + "min_machines_running": { + "type": "integer" + }, + "ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fly.MachinePort" + } + }, + "protocol": { + "type": "string" + } + } + }, + "fly.MachineServiceConcurrency": { + "type": "object", + "properties": { + "hard_limit": { + "type": "integer" + }, + "soft_limit": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "fly.ProxyProtoOptions": { + "type": "object", + "properties": { + "version": { + "type": "string" + } + } + }, + "fly.Static": { + "required": [ + "guest_path", + "url_prefix" + ], + "type": "object", + "properties": { + "guest_path": { + "type": "string" + }, + "index_document": { + "type": "string" + }, + "tigris_bucket": { + "type": "string" + }, + "url_prefix": { + "type": "string" + } + } + }, + "fly.StopConfig": { + "type": "object", + "properties": { + "signal": { + "type": "string" + }, + "timeout": { + "$ref": "#/components/schemas/fly.Duration" + } + } + }, + "fly.TCPHealthcheck": { + "type": "object", + "properties": { + "port": { + "type": "integer", + "description": "The port to connect to, often the same as internal_port" + } + } + }, + "fly.TLSOptions": { + "type": "object", + "properties": { + "alpn": { + "type": "array", + "items": { + "type": "string" + } + }, + "default_self_signed": { + "type": "boolean" + }, + "versions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "fly.TempDirVolume": { + "type": "object", + "properties": { + "size_mb": { + "type": "integer", + "description": "The size limit of the temp dir, only applicable when using disk backed storage." + }, + "storage_type": { + "type": "string", + "description": "The type of storage used to back the temp dir. Either disk or memory." + } + } + }, + "fly.UnhealthyPolicy": { + "type": "string", + "enum": [ + "stop" + ], + "x-enum-varnames": [ + "UnhealthyPolicyStop" + ] + }, + "fly.VolumeConfig": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the volume. A volume must have a unique name within an app" + }, + "temp_dir": { + "$ref": "#/components/schemas/fly.TempDirVolume" + } + } + }, + "fly.dnsForwardRule": { + "type": "object", + "properties": { + "addr": { + "type": "string" + }, + "basename": { + "type": "string" + } + } + }, + "fly.dnsOption": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "flydv1.ExecResponse": { + "type": "object", + "properties": { + "exit_code": { + "type": "integer" + }, + "exit_signal": { + "type": "integer" + }, + "stderr": { + "type": "string" + }, + "stdout": { + "type": "string" + } + } + }, + "main.statusCode": { + "type": "string", + "enum": [ + "unknown", + "insufficient_capacity" + ], + "x-enum-varnames": [ + "unknown", + "capacityErr" + ] + } + } + }, + "x-original-swagger-version": "2.0" +} \ No newline at end of file diff --git a/apps/cli/test/openapi/fixtures/fly_api.spec b/apps/cli/test/openapi/fixtures/fly_api.spec new file mode 100644 index 000000000..63967aeff --- /dev/null +++ b/apps/cli/test/openapi/fixtures/fly_api.spec @@ -0,0 +1,7313 @@ +OpenApiDocument { + version=3.0.1, + info=OpenApiInfo { + title=Machines API, + description=This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/) for how to get started, more information about each endpoint, parameter descriptions, and examples., + apiVersion=1.0, + contact=OpenApiContact { + ref=#/info/contact, + node={}, + }, + license=OpenApiLicense { + name=Apache 2.0, + url=http://www.apache.org/licenses/LICENSE-2.0.html, + ref=#/info/license, + node={name: Apache 2.0, url: http://www.apache.org/licenses/LICENSE-2.0.html}, + }, + ref=#/info, + node={title: Machines API, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/) for how to get started, more information about each endpoint, parameter descriptions, and examples., contact: {}, license: {name: Apache 2.0, url: http://www.apache.org/licenses/LICENSE-2.0.html}, version: 1.0}, + }, + servers=[OpenApiServer { + url=https://api.machines.dev/v1, + variables={}, + ref=#/servers/0, + node={url: https://api.machines.dev/v1}, + }], + paths={/apps: OpenApiComponentOrRef { + ref=#/paths//apps, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Apps], + summary=List Apps, + description=List all apps with the ability to filter by organization slug. +, + operationId=Apps_list, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/get/parameters/0, + component=OpenApiParameter { + name=org_slug, + location=query, + description=The org slug, or 'personal', to filter apps, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/get/parameters/0, + node={name: org_slug, in: query, description: The org slug, or 'personal', to filter apps, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ListAppsResponse, + name=ListAppsResponse, + node={$ref: #/components/schemas/ListAppsResponse}, + }, + node={$ref: #/components/schemas/ListAppsResponse}, + }, + encoding={}, + ref=#/paths//apps/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/ListAppsResponse}}, + }}, + ref=#/paths//apps/get/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/ListAppsResponse}}}}, + }, + }}, + }, post: OpenApiOperation { + type=post, + tags=[Apps], + summary=Create App, + description=Create an app with the specified details in the request body. +, + operationId=Apps_create, + parameters=[], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/CreateAppRequest, + name=CreateAppRequest, + node={$ref: #/components/schemas/CreateAppRequest}, + }, + node={$ref: #/components/schemas/CreateAppRequest}, + }, + encoding={}, + ref=#/paths//apps/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/CreateAppRequest}}, + }}, + description=App body, + required=true, + ref=#/paths//apps/post/requestBody, + node={description: App body, content: {application/json: {schema: {$ref: #/components/schemas/CreateAppRequest}}}, required: true}, + }, + }, + responses={201: OpenApiComponentOrRef { + ref=#/paths//apps/post/responses/201, + component=OpenApiResponse { + description=Created, + content={}, + ref=#/paths//apps/post/responses/201, + node={description: Created, content: {}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//apps, + node={get: {tags: [Apps], summary: List Apps, description: List all apps with the ability to filter by organization slug. +, operationId: Apps_list, parameters: [{name: org_slug, in: query, description: The org slug, or 'personal', to filter apps, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/ListAppsResponse}}}}}}, post: {tags: [Apps], summary: Create App, description: Create an app with the specified details in the request body. +, operationId: Apps_create, requestBody: {description: App body, content: {application/json: {schema: {$ref: #/components/schemas/CreateAppRequest}}}, required: true}, responses: {201: {description: Created, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, + }, + }, /apps/{app_name}: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Apps], + summary=Get App, + description=Retrieve details about a specific app by its name. +, + operationId=Apps_show, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/App, + name=App, + node={$ref: #/components/schemas/App}, + }, + node={$ref: #/components/schemas/App}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/App}}, + }}, + ref=#/paths//apps/{app_name}/get/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/App}}}}, + }, + }}, + }, delete: OpenApiOperation { + type=delete, + tags=[Apps], + summary=Destroy App, + description=Delete an app by its name. +, + operationId=Apps_delete, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/delete/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/delete/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/delete/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/delete/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }], + responses={202: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/delete/responses/202, + component=OpenApiResponse { + description=Accepted, + content={}, + ref=#/paths//apps/{app_name}/delete/responses/202, + node={description: Accepted, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}, + node={get: {tags: [Apps], summary: Get App, description: Retrieve details about a specific app by its name. +, operationId: Apps_show, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/App}}}}}}, delete: {tags: [Apps], summary: Destroy App, description: Delete an app by its name. +, operationId: Apps_delete, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], responses: {202: {description: Accepted, content: {}}}}}, + }, + }, /apps/{app_name}/machines: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Machines], + summary=List Machines, + description=List all Machines associated with a specific app, with optional filters for including deleted Machines and filtering by region. +, + operationId=Machines_list, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/1, + component=OpenApiParameter { + name=include_deleted, + location=query, + description=Include deleted machines, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/1/schema, + component=OpenApiSchema { + type=boolean, + ref=#/paths//apps/{app_name}/machines/get/parameters/1/schema, + node={type: boolean}, + }, + }, + ref=#/paths//apps/{app_name}/machines/get/parameters/1, + node={name: include_deleted, in: query, description: Include deleted machines, schema: {type: boolean}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/2, + component=OpenApiParameter { + name=region, + location=query, + description=Region filter, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/get/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/get/parameters/2, + node={name: region, in: query, description: Region filter, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/3, + component=OpenApiParameter { + name=state, + location=query, + description=comma separated list of states to filter (created, started, stopped, suspended), + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/3/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/get/parameters/3/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/get/parameters/3, + node={name: state, in: query, description: comma separated list of states to filter (created, started, stopped, suspended), schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/4, + component=OpenApiParameter { + name=summary, + location=query, + description=Only return summary info about machines (omit config, checks, events, host_status, nonce, etc.), + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/parameters/4/schema, + component=OpenApiSchema { + type=boolean, + ref=#/paths//apps/{app_name}/machines/get/parameters/4/schema, + node={type: boolean}, + }, + }, + ref=#/paths//apps/{app_name}/machines/get/parameters/4, + node={name: summary, in: query, description: Only return summary info about machines (omit config, checks, events, host_status, nonce, etc.), schema: {type: boolean}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=array, + items=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/get/responses/200/content/application/json/schema/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Machine, + name=Machine, + node={$ref: #/components/schemas/Machine}, + }, + node={$ref: #/components/schemas/Machine}, + }, + ref=#/paths//apps/{app_name}/machines/get/responses/200/content/application/json/schema, + node={type: array, items: {$ref: #/components/schemas/Machine}}, + }, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/get/responses/200/content/application/json, + node={schema: {type: array, items: {$ref: #/components/schemas/Machine}}}, + }}, + ref=#/paths//apps/{app_name}/machines/get/responses/200, + node={description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/Machine}}}}}, + }, + }}, + }, post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Create Machine, + description=Create a Machine within a specific app using the details provided in the request body. + +**Important**: This request can fail, and you’re responsible for handling that failure. If you ask for a large Machine, or a Machine in a region we happen to be at capacity for, you might need to retry the request, or to fall back to another region. If you’re working directly with the Machines API, you’re taking some responsibility for your own orchestration! +, + operationId=Machines_create, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/CreateMachineRequest, + name=CreateMachineRequest, + node={$ref: #/components/schemas/CreateMachineRequest}, + }, + node={$ref: #/components/schemas/CreateMachineRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/CreateMachineRequest}}, + }}, + description=Create machine request, + required=true, + ref=#/paths//apps/{app_name}/machines/post/requestBody, + node={description: Create machine request, content: {application/json: {schema: {$ref: #/components/schemas/CreateMachineRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/post/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/post/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Machine, + name=Machine, + node={$ref: #/components/schemas/Machine}, + }, + node={$ref: #/components/schemas/Machine}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/post/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Machine}}, + }}, + ref=#/paths//apps/{app_name}/machines/post/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines, + node={get: {tags: [Machines], summary: List Machines, description: List all Machines associated with a specific app, with optional filters for including deleted Machines and filtering by region. +, operationId: Machines_list, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: include_deleted, in: query, description: Include deleted machines, schema: {type: boolean}}, {name: region, in: query, description: Region filter, schema: {type: string}}, {name: state, in: query, description: comma separated list of states to filter (created, started, stopped, suspended), schema: {type: string}}, {name: summary, in: query, description: Only return summary info about machines (omit config, checks, events, host_status, nonce, etc.), schema: {type: boolean}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/Machine}}}}}}}, post: {tags: [Machines], summary: Create Machine, description: Create a Machine within a specific app using the details provided in the request body. + +**Important**: This request can fail, and you’re responsible for handling that failure. If you ask for a large Machine, or a Machine in a region we happen to be at capacity for, you might need to retry the request, or to fall back to another region. If you’re working directly with the Machines API, you’re taking some responsibility for your own orchestration! +, operationId: Machines_create, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], requestBody: {description: Create machine request, content: {application/json: {schema: {$ref: #/components/schemas/CreateMachineRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}}, x-codegen-request-body-name: request}}, + }, + }, /apps/{app_name}/machines/{machine_id}: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Machines], + summary=Get Machine, + description=Get details of a specific Machine within an app by the Machine ID. +, + operationId=Machines_show, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Machine, + name=Machine, + node={$ref: #/components/schemas/Machine}, + }, + node={$ref: #/components/schemas/Machine}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Machine}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/get/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}, + }, + }}, + }, post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Update Machine, + description=Update a Machine's configuration using the details provided in the request body. +, + operationId=Machines_update, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/UpdateMachineRequest, + name=UpdateMachineRequest, + node={$ref: #/components/schemas/UpdateMachineRequest}, + }, + node={$ref: #/components/schemas/UpdateMachineRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/UpdateMachineRequest}}, + }}, + description=Request body, + required=true, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/requestBody, + node={description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/UpdateMachineRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Machine, + name=Machine, + node={$ref: #/components/schemas/Machine}, + }, + node={$ref: #/components/schemas/Machine}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Machine}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }, delete: OpenApiOperation { + type=delete, + tags=[Machines], + summary=Destroy Machine, + description=Delete a specific Machine within an app by Machine ID, with an optional force parameter to force kill the Machine if it's running. +, + operationId=Machines_delete, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/2, + component=OpenApiParameter { + name=force, + location=query, + description=Force kill the machine if it's running, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/2/schema, + component=OpenApiSchema { + type=boolean, + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/2/schema, + node={type: boolean}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/parameters/2, + node={name: force, in: query, description: Force kill the machine if it's running, schema: {type: boolean}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/delete/responses/200, + node={description: OK, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}, + node={get: {tags: [Machines], summary: Get Machine, description: Get details of a specific Machine within an app by the Machine ID. +, operationId: Machines_show, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}}}, post: {tags: [Machines], summary: Update Machine, description: Update a Machine's configuration using the details provided in the request body. +, operationId: Machines_update, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/UpdateMachineRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}, delete: {tags: [Machines], summary: Destroy Machine, description: Delete a specific Machine within an app by Machine ID, with an optional force parameter to force kill the Machine if it's running. +, operationId: Machines_delete, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: force, in: query, description: Force kill the machine if it's running, schema: {type: boolean}}], responses: {200: {description: OK, content: {}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/cordon: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Cordon Machine, + description=“Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones. +, + operationId=Machines_cordon, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon/post/responses/200, + node={description: OK, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/cordon, + node={post: {tags: [Machines], summary: Cordon Machine, description: “Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones. +, operationId: Machines_cordon, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/events: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/events, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Machines], + summary=List Events, + description=List all events associated with a specific Machine within an app. +, + operationId=Machines_list_events, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=array, + items=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/responses/200/content/application/json/schema/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/MachineEvent, + name=MachineEvent, + node={$ref: #/components/schemas/MachineEvent}, + }, + node={$ref: #/components/schemas/MachineEvent}, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/responses/200/content/application/json/schema, + node={type: array, items: {$ref: #/components/schemas/MachineEvent}}, + }, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/responses/200/content/application/json, + node={schema: {type: array, items: {$ref: #/components/schemas/MachineEvent}}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/events/get/responses/200, + node={description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/MachineEvent}}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/events, + node={get: {tags: [Machines], summary: List Events, description: List all events associated with a specific Machine within an app. +, operationId: Machines_list_events, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/MachineEvent}}}}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/exec: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Execute Command, + description=Execute a command on a specific Machine and return the raw command output bytes. +, + operationId=Machines_exec, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/MachineExecRequest, + name=MachineExecRequest, + node={$ref: #/components/schemas/MachineExecRequest}, + }, + node={$ref: #/components/schemas/MachineExecRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/MachineExecRequest}}, + }}, + description=Request body, + required=true, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/requestBody, + node={description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/MachineExecRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/200, + component=OpenApiResponse { + description=stdout, stderr, exit code, and exit signal are returned, + content={application/octet-stream: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/200/content/application/octet-stream/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/flydv1.ExecResponse, + name=flydv1.ExecResponse, + node={$ref: #/components/schemas/flydv1.ExecResponse}, + }, + node={$ref: #/components/schemas/flydv1.ExecResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/200/content/application/octet-stream, + node={schema: {$ref: #/components/schemas/flydv1.ExecResponse}}, + }, application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/flydv1.ExecResponse, + name=flydv1.ExecResponse, + node={$ref: #/components/schemas/flydv1.ExecResponse}, + }, + node={$ref: #/components/schemas/flydv1.ExecResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/flydv1.ExecResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/200, + node={description: stdout, stderr, exit code, and exit signal are returned, content: {application/octet-stream: {schema: {$ref: #/components/schemas/flydv1.ExecResponse}}, application/json: {schema: {$ref: #/components/schemas/flydv1.ExecResponse}}}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/octet-stream: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/400/content/application/octet-stream/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/400/content/application/octet-stream, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }, application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec/post/responses/400, + node={description: Bad Request, content: {application/octet-stream: {schema: {$ref: #/components/schemas/ErrorResponse}}, application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/exec, + node={post: {tags: [Machines], summary: Execute Command, description: Execute a command on a specific Machine and return the raw command output bytes. +, operationId: Machines_exec, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/MachineExecRequest}}}, required: true}, responses: {200: {description: stdout, stderr, exit code, and exit signal are returned, content: {application/octet-stream: {schema: {$ref: #/components/schemas/flydv1.ExecResponse}}, application/json: {schema: {$ref: #/components/schemas/flydv1.ExecResponse}}}}, 400: {description: Bad Request, content: {application/octet-stream: {schema: {$ref: #/components/schemas/ErrorResponse}}, application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, + }, + }, /apps/{app_name}/machines/{machine_id}/lease: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Machines], + summary=Get Lease, + description=Retrieve the current lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, + operationId=Machines_show_lease, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Lease, + name=Lease, + node={$ref: #/components/schemas/Lease}, + }, + node={$ref: #/components/schemas/Lease}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Lease}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/get/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Lease}}}}, + }, + }}, + }, post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Create Lease, + description=Create a lease for a specific Machine within an app using the details provided in the request body. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, + operationId=Machines_create_lease, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/2, + component=OpenApiParameter { + name=fly-machine-lease-nonce, + location=header, + description=Existing lease nonce to refresh by ttl, empty or non-existent to create a new lease, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/parameters/2, + node={name: fly-machine-lease-nonce, in: header, description: Existing lease nonce to refresh by ttl, empty or non-existent to create a new lease, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/CreateLeaseRequest, + name=CreateLeaseRequest, + node={$ref: #/components/schemas/CreateLeaseRequest}, + }, + node={$ref: #/components/schemas/CreateLeaseRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/CreateLeaseRequest}}, + }}, + description=Request body, + required=true, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/requestBody, + node={description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateLeaseRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Lease, + name=Lease, + node={$ref: #/components/schemas/Lease}, + }, + node={$ref: #/components/schemas/Lease}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Lease}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/post/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Lease}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }, delete: OpenApiOperation { + type=delete, + tags=[Machines], + summary=Release Lease, + description=Release the lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, + operationId=Machines_release_lease, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/2, + component=OpenApiParameter { + name=fly-machine-lease-nonce, + location=header, + description=Existing lease nonce, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/parameters/2, + node={name: fly-machine-lease-nonce, in: header, description: Existing lease nonce, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease/delete/responses/200, + node={description: OK, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/lease, + node={get: {tags: [Machines], summary: Get Lease, description: Retrieve the current lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, operationId: Machines_show_lease, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Lease}}}}}}, post: {tags: [Machines], summary: Create Lease, description: Create a lease for a specific Machine within an app using the details provided in the request body. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, operationId: Machines_create_lease, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: fly-machine-lease-nonce, in: header, description: Existing lease nonce to refresh by ttl, empty or non-existent to create a new lease, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateLeaseRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Lease}}}}}, x-codegen-request-body-name: request}, delete: {tags: [Machines], summary: Release Lease, description: Release the lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, operationId: Machines_release_lease, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: fly-machine-lease-nonce, in: header, description: Existing lease nonce, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/metadata: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Machines], + summary=Get Metadata, + description=Retrieve metadata for a specific Machine within an app. +, + operationId=Machines_show_metadata, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=object, + additionalProperties=OpenApiAdditionalProperties { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/responses/200/content/application/json/schema/additionalProperties, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/responses/200/content/application/json/schema/additionalProperties, + node={type: string}, + }, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/responses/200/content/application/json/schema, + node={type: object, additionalProperties: {type: string}}, + }, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/responses/200/content/application/json, + node={schema: {type: object, additionalProperties: {type: string}}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/get/responses/200, + node={description: OK, content: {application/json: {schema: {type: object, additionalProperties: {type: string}}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata, + node={get: {tags: [Machines], summary: Get Metadata, description: Retrieve metadata for a specific Machine within an app. +, operationId: Machines_show_metadata, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: object, additionalProperties: {type: string}}}}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/metadata/{key}: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Update Metadata, + description=Update metadata for a specific machine within an app by providing a metadata key. +, + operationId=Machines_update_metadata, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/2, + component=OpenApiParameter { + name=key, + location=path, + description=Metadata Key, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/parameters/2, + node={name: key, in: path, description: Metadata Key, required: true, schema: {type: string}}, + }, + }], + responses={204: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/responses/204, + component=OpenApiResponse { + description=No Content, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/responses/204, + node={description: No Content, content: {}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + }, delete: OpenApiOperation { + type=delete, + tags=[Machines], + summary=Delete Metadata, + description=Delete metadata for a specific Machine within an app by providing a metadata key. +, + operationId=Machines_delete_metadata, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/2, + component=OpenApiParameter { + name=key, + location=path, + description=Metadata Key, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/parameters/2, + node={name: key, in: path, description: Metadata Key, required: true, schema: {type: string}}, + }, + }], + responses={204: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/responses/204, + component=OpenApiResponse { + description=No Content, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}/delete/responses/204, + node={description: No Content, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/metadata/{key}, + node={post: {tags: [Machines], summary: Update Metadata, description: Update metadata for a specific machine within an app by providing a metadata key. +, operationId: Machines_update_metadata, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: key, in: path, description: Metadata Key, required: true, schema: {type: string}}], responses: {204: {description: No Content, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}, delete: {tags: [Machines], summary: Delete Metadata, description: Delete metadata for a specific Machine within an app by providing a metadata key. +, operationId: Machines_delete_metadata, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: key, in: path, description: Metadata Key, required: true, schema: {type: string}}], responses: {204: {description: No Content, content: {}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/ps: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Machines], + summary=List Processes, + description=List all processes running on a specific Machine within an app, with optional sorting parameters. +, + operationId=Machines_list_processes, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/2, + component=OpenApiParameter { + name=sort_by, + location=query, + description=Sort by, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/2, + node={name: sort_by, in: query, description: Sort by, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/3, + component=OpenApiParameter { + name=order, + location=query, + description=Order, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/3/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/3/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/parameters/3, + node={name: order, in: query, description: Order, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=array, + items=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/200/content/application/json/schema/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ProcessStat, + name=ProcessStat, + node={$ref: #/components/schemas/ProcessStat}, + }, + node={$ref: #/components/schemas/ProcessStat}, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/200/content/application/json/schema, + node={type: array, items: {$ref: #/components/schemas/ProcessStat}}, + }, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/200/content/application/json, + node={schema: {type: array, items: {$ref: #/components/schemas/ProcessStat}}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/200, + node={description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/ProcessStat}}}}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps/get/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/ps, + node={get: {tags: [Machines], summary: List Processes, description: List all processes running on a specific Machine within an app, with optional sorting parameters. +, operationId: Machines_list_processes, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: sort_by, in: query, description: Sort by, schema: {type: string}}, {name: order, in: query, description: Order, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/ProcessStat}}}}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/restart: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Restart Machine, + description=Restart a specific Machine within an app, with an optional timeout parameter. +, + operationId=Machines_restart, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/2, + component=OpenApiParameter { + name=timeout, + location=query, + description=Restart timeout as a Go duration string or number of seconds, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/2, + node={name: timeout, in: query, description: Restart timeout as a Go duration string or number of seconds, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/3, + component=OpenApiParameter { + name=signal, + location=query, + description=Unix signal name, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/3/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/3/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/parameters/3, + node={name: signal, in: query, description: Unix signal name, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/responses/200, + node={description: OK, content: {}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/restart, + node={post: {tags: [Machines], summary: Restart Machine, description: Restart a specific Machine within an app, with an optional timeout parameter. +, operationId: Machines_restart, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: timeout, in: query, description: Restart timeout as a Go duration string or number of seconds, schema: {type: string}}, {name: signal, in: query, description: Unix signal name, schema: {type: string}}], responses: {200: {description: OK, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/signal: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Signal Machine, + description=Send a signal to a specific Machine within an app using the details provided in the request body. +, + operationId=Machines_signal, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/SignalRequest, + name=SignalRequest, + node={$ref: #/components/schemas/SignalRequest}, + }, + node={$ref: #/components/schemas/SignalRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/SignalRequest}}, + }}, + description=Request body, + required=true, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/requestBody, + node={description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/SignalRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/responses/200, + node={description: OK, content: {}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/signal, + node={post: {tags: [Machines], summary: Signal Machine, description: Send a signal to a specific Machine within an app using the details provided in the request body. +, operationId: Machines_signal, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/SignalRequest}}}, required: true}, responses: {200: {description: OK, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, + }, + }, /apps/{app_name}/machines/{machine_id}/start: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/start, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Start Machine, + description=Start a specific Machine within an app. +, + operationId=Machines_start, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/start/post/responses/200, + node={description: OK, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/start, + node={post: {tags: [Machines], summary: Start Machine, description: Start a specific Machine within an app. +, operationId: Machines_start, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/stop: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Stop Machine, + description=Stop a specific Machine within an app, with an optional request body to specify signal and timeout. +, + operationId=Machines_stop, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/StopRequest, + name=StopRequest, + node={$ref: #/components/schemas/StopRequest}, + }, + node={$ref: #/components/schemas/StopRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/StopRequest}}, + }}, + description=Optional request body, + required=false, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/requestBody, + node={description: Optional request body, content: {application/json: {schema: {$ref: #/components/schemas/StopRequest}}}, required: false}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/responses/200, + node={description: OK, content: {}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/stop, + node={post: {tags: [Machines], summary: Stop Machine, description: Stop a specific Machine within an app, with an optional request body to specify signal and timeout. +, operationId: Machines_stop, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], requestBody: {description: Optional request body, content: {application/json: {schema: {$ref: #/components/schemas/StopRequest}}}, required: false}, responses: {200: {description: OK, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, + }, + }, /apps/{app_name}/machines/{machine_id}/suspend: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Suspend Machine, + description=Suspend a specific Machine within an app. The next start operation will attempt (but is not guaranteed) to resume the Machine from a snapshot taken at suspension time, rather than performing a cold boot. +, + operationId=Machines_suspend, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend/post/responses/200, + node={description: OK, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/suspend, + node={post: {tags: [Machines], summary: Suspend Machine, description: Suspend a specific Machine within an app. The next start operation will attempt (but is not guaranteed) to resume the Machine from a snapshot taken at suspension time, rather than performing a cold boot. +, operationId: Machines_suspend, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/uncordon: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Machines], + summary=Uncordon Machine, + description=“Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones. +, + operationId=Machines_uncordon, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon/post/responses/200, + node={description: OK, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/uncordon, + node={post: {tags: [Machines], summary: Uncordon Machine, description: “Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones. +, operationId: Machines_uncordon, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/versions: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Machines], + summary=List Versions, + description=List all versions of the configuration for a specific Machine within an app. +, + operationId=Machines_list_versions, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=array, + items=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/responses/200/content/application/json/schema/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/MachineVersion, + name=MachineVersion, + node={$ref: #/components/schemas/MachineVersion}, + }, + node={$ref: #/components/schemas/MachineVersion}, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/responses/200/content/application/json/schema, + node={type: array, items: {$ref: #/components/schemas/MachineVersion}}, + }, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/responses/200/content/application/json, + node={schema: {type: array, items: {$ref: #/components/schemas/MachineVersion}}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions/get/responses/200, + node={description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/MachineVersion}}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/versions, + node={get: {tags: [Machines], summary: List Versions, description: List all versions of the configuration for a specific Machine within an app. +, operationId: Machines_list_versions, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/MachineVersion}}}}}}}}, + }, + }, /apps/{app_name}/machines/{machine_id}/wait: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Machines], + summary=Wait for State, + description=Wait for a Machine to reach a specific state. Specify the desired state with the state parameter. See the [Machine states table](https://fly.io/docs/machines/working-with-machines/#machine-states) for a list of possible states. The default for this parameter is `started`. + +This request will block for up to 60 seconds. Set a shorter timeout with the timeout parameter. +, + operationId=Machines_wait, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/1, + component=OpenApiParameter { + name=machine_id, + location=path, + description=Machine ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/1, + node={name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/2, + component=OpenApiParameter { + name=instance_id, + location=query, + description=26-character Machine version ID, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/2, + node={name: instance_id, in: query, description: 26-character Machine version ID, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/3, + component=OpenApiParameter { + name=timeout, + location=query, + description=wait timeout. default 60s, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/3/schema, + component=OpenApiSchema { + type=integer, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/3/schema, + node={type: integer}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/3, + node={name: timeout, in: query, description: wait timeout. default 60s, schema: {type: integer}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/4, + component=OpenApiParameter { + name=state, + location=query, + description=desired state, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/4/schema, + component=OpenApiSchema { + type=string, + enumValues={started, stopped, suspended, destroyed}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/4/schema, + node={type: string, enum: [started, stopped, suspended, destroyed]}, + }, + }, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/parameters/4, + node={name: state, in: query, description: desired state, schema: {type: string, enum: [started, stopped, suspended, destroyed]}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/responses/200, + node={description: OK, content: {}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait/get/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/machines/{machine_id}/wait, + node={get: {tags: [Machines], summary: Wait for State, description: Wait for a Machine to reach a specific state. Specify the desired state with the state parameter. See the [Machine states table](https://fly.io/docs/machines/working-with-machines/#machine-states) for a list of possible states. The default for this parameter is `started`. + +This request will block for up to 60 seconds. Set a shorter timeout with the timeout parameter. +, operationId: Machines_wait, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: instance_id, in: query, description: 26-character Machine version ID, schema: {type: string}}, {name: timeout, in: query, description: wait timeout. default 60s, schema: {type: integer}}, {name: state, in: query, description: desired state, schema: {type: string, enum: [started, stopped, suspended, destroyed]}}], responses: {200: {description: OK, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}}, + }, + }, /apps/{app_name}/secrets: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Secrets], + summary=List App secrets, + operationId=Secrets_list, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/get/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=array, + items=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/get/responses/200/content/application/json/schema/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ListSecret, + name=ListSecret, + node={$ref: #/components/schemas/ListSecret}, + }, + node={$ref: #/components/schemas/ListSecret}, + }, + ref=#/paths//apps/{app_name}/secrets/get/responses/200/content/application/json/schema, + node={type: array, items: {$ref: #/components/schemas/ListSecret}}, + }, + }, + encoding={}, + ref=#/paths//apps/{app_name}/secrets/get/responses/200/content/application/json, + node={schema: {type: array, items: {$ref: #/components/schemas/ListSecret}}}, + }}, + ref=#/paths//apps/{app_name}/secrets/get/responses/200, + node={description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/ListSecret}}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/secrets, + node={get: {tags: [Secrets], summary: List App secrets, operationId: Secrets_list, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/ListSecret}}}}}}}}, + }, + }, /apps/{app_name}/secrets/{secret_label}: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}, + component=OpenApiPathItem { + operations={delete: OpenApiOperation { + type=delete, + tags=[Secrets], + summary=Destroy Secret, + operationId=Secret_delete, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/parameters/1, + component=OpenApiParameter { + name=secret_label, + location=path, + description=App Secret Label, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/parameters/1, + node={name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/delete/responses/200, + node={description: OK, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/secrets/{secret_label}, + node={delete: {tags: [Secrets], summary: Destroy Secret, operationId: Secret_delete, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, + }, + }, /apps/{app_name}/secrets/{secret_label}/type/{secret_type}: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Secrets], + summary=Create Secret, + operationId=Secret_create, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/1, + component=OpenApiParameter { + name=secret_label, + location=path, + description=App Secret Label, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/1, + node={name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/2, + component=OpenApiParameter { + name=secret_type, + location=path, + description=App Secret Type, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/parameters/2, + node={name: secret_type, in: path, description: App Secret Type, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/CreateSecretRequest, + name=CreateSecretRequest, + node={$ref: #/components/schemas/CreateSecretRequest}, + }, + node={$ref: #/components/schemas/CreateSecretRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/CreateSecretRequest}}, + }}, + description=secret body, + required=true, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/requestBody, + node={description: secret body, content: {application/json: {schema: {$ref: #/components/schemas/CreateSecretRequest}}}, required: true}, + }, + }, + responses={201: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/responses/201, + component=OpenApiResponse { + description=Created, + content={}, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/responses/201, + node={description: Created, content: {}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}, + node={post: {tags: [Secrets], summary: Create Secret, operationId: Secret_create, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}, {name: secret_type, in: path, description: App Secret Type, required: true, schema: {type: string}}], requestBody: {description: secret body, content: {application/json: {schema: {$ref: #/components/schemas/CreateSecretRequest}}}, required: true}, responses: {201: {description: Created, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, + }, + }, /apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Secrets], + summary=Generate Secret, + operationId=Secret_generate, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/1, + component=OpenApiParameter { + name=secret_label, + location=path, + description=App Secret Label, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/1, + node={name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/2, + component=OpenApiParameter { + name=secret_type, + location=path, + description=App Secret Type, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/2/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/2/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/parameters/2, + node={name: secret_type, in: path, description: App Secret Type, required: true, schema: {type: string}}, + }, + }], + responses={201: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/responses/201, + component=OpenApiResponse { + description=Created, + content={}, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/responses/201, + node={description: Created, content: {}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate, + node={post: {tags: [Secrets], summary: Generate Secret, operationId: Secret_generate, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}, {name: secret_type, in: path, description: App Secret Type, required: true, schema: {type: string}}], responses: {201: {description: Created, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}}, + }, + }, /apps/{app_name}/volumes: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Volumes], + summary=List Volumes, + description=List all volumes associated with a specific app. +, + operationId=Volumes_list, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/get/parameters/1, + component=OpenApiParameter { + name=summary, + location=query, + description=Only return summary info about volumes (omit blocks, block size, etc), + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/get/parameters/1/schema, + component=OpenApiSchema { + type=boolean, + ref=#/paths//apps/{app_name}/volumes/get/parameters/1/schema, + node={type: boolean}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/get/parameters/1, + node={name: summary, in: query, description: Only return summary info about volumes (omit blocks, block size, etc), schema: {type: boolean}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/get/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=array, + items=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/get/responses/200/content/application/json/schema/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Volume, + name=Volume, + node={$ref: #/components/schemas/Volume}, + }, + node={$ref: #/components/schemas/Volume}, + }, + ref=#/paths//apps/{app_name}/volumes/get/responses/200/content/application/json/schema, + node={type: array, items: {$ref: #/components/schemas/Volume}}, + }, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/get/responses/200/content/application/json, + node={schema: {type: array, items: {$ref: #/components/schemas/Volume}}}, + }}, + ref=#/paths//apps/{app_name}/volumes/get/responses/200, + node={description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/Volume}}}}}, + }, + }}, + }, post: OpenApiOperation { + type=post, + tags=[Volumes], + summary=Create Volume, + description=Create a volume for a specific app using the details provided in the request body. +, + operationId=Volumes_create, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/CreateVolumeRequest, + name=CreateVolumeRequest, + node={$ref: #/components/schemas/CreateVolumeRequest}, + }, + node={$ref: #/components/schemas/CreateVolumeRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/CreateVolumeRequest}}, + }}, + description=Request body, + required=true, + ref=#/paths//apps/{app_name}/volumes/post/requestBody, + node={description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateVolumeRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/post/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/post/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Volume, + name=Volume, + node={$ref: #/components/schemas/Volume}, + }, + node={$ref: #/components/schemas/Volume}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/post/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Volume}}, + }}, + ref=#/paths//apps/{app_name}/volumes/post/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/volumes, + node={get: {tags: [Volumes], summary: List Volumes, description: List all volumes associated with a specific app. +, operationId: Volumes_list, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: summary, in: query, description: Only return summary info about volumes (omit blocks, block size, etc), schema: {type: boolean}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/Volume}}}}}}}, post: {tags: [Volumes], summary: Create Volume, description: Create a volume for a specific app using the details provided in the request body. +, operationId: Volumes_create, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateVolumeRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}}, x-codegen-request-body-name: request}}, + }, + }, /apps/{app_name}/volumes/{volume_id}: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Volumes], + summary=Get Volume, + description=Retrieve details about a specific volume by its ID within an app. +, + operationId=Volumes_get_by_id, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/parameters/1, + component=OpenApiParameter { + name=volume_id, + location=path, + description=Volume ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/parameters/1, + node={name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Volume, + name=Volume, + node={$ref: #/components/schemas/Volume}, + }, + node={$ref: #/components/schemas/Volume}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Volume}}, + }}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/get/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}, + }, + }}, + }, put: OpenApiOperation { + type=put, + tags=[Volumes], + summary=Update Volume, + description=Update a volume's configuration using the details provided in the request body. +, + operationId=Volumes_update, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/parameters/1, + component=OpenApiParameter { + name=volume_id, + location=path, + description=Volume ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/parameters/1, + node={name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/UpdateVolumeRequest, + name=UpdateVolumeRequest, + node={$ref: #/components/schemas/UpdateVolumeRequest}, + }, + node={$ref: #/components/schemas/UpdateVolumeRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/UpdateVolumeRequest}}, + }}, + description=Request body, + required=true, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/requestBody, + node={description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/UpdateVolumeRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Volume, + name=Volume, + node={$ref: #/components/schemas/Volume}, + }, + node={$ref: #/components/schemas/Volume}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Volume}}, + }}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/put/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }, delete: OpenApiOperation { + type=delete, + tags=[Volumes], + summary=Destroy Volume, + description=Delete a specific volume within an app by volume ID. +, + operationId=Volume_delete, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/parameters/1, + component=OpenApiParameter { + name=volume_id, + location=path, + description=Volume ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/parameters/1, + node={name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Volume, + name=Volume, + node={$ref: #/components/schemas/Volume}, + }, + node={$ref: #/components/schemas/Volume}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/Volume}}, + }}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/delete/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/volumes/{volume_id}, + node={get: {tags: [Volumes], summary: Get Volume, description: Retrieve details about a specific volume by its ID within an app. +, operationId: Volumes_get_by_id, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}}}, put: {tags: [Volumes], summary: Update Volume, description: Update a volume's configuration using the details provided in the request body. +, operationId: Volumes_update, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/UpdateVolumeRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}, delete: {tags: [Volumes], summary: Destroy Volume, description: Delete a specific volume within an app by volume ID. +, operationId: Volume_delete, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}}}}, + }, + }, /apps/{app_name}/volumes/{volume_id}/extend: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend, + component=OpenApiPathItem { + operations={put: OpenApiOperation { + type=put, + tags=[Volumes], + summary=Extend Volume, + description=Extend a volume's size within an app using the details provided in the request body. +, + operationId=Volumes_extend, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/parameters/1, + component=OpenApiParameter { + name=volume_id, + location=path, + description=Volume ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/parameters/1, + node={name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}, + }, + }], + requestBody=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ExtendVolumeRequest, + name=ExtendVolumeRequest, + node={$ref: #/components/schemas/ExtendVolumeRequest}, + }, + node={$ref: #/components/schemas/ExtendVolumeRequest}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/ExtendVolumeRequest}}, + }}, + description=Request body, + required=true, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/requestBody, + node={description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/ExtendVolumeRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/responses/200/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ExtendVolumeResponse, + name=ExtendVolumeResponse, + node={$ref: #/components/schemas/ExtendVolumeResponse}, + }, + node={$ref: #/components/schemas/ExtendVolumeResponse}, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/responses/200/content/application/json, + node={schema: {$ref: #/components/schemas/ExtendVolumeResponse}}, + }}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend/put/responses/200, + node={description: OK, content: {application/json: {schema: {$ref: #/components/schemas/ExtendVolumeResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/volumes/{volume_id}/extend, + node={put: {tags: [Volumes], summary: Extend Volume, description: Extend a volume's size within an app using the details provided in the request body. +, operationId: Volumes_extend, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/ExtendVolumeRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/ExtendVolumeResponse}}}}}, x-codegen-request-body-name: request}}, + }, + }, /apps/{app_name}/volumes/{volume_id}/snapshots: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots, + component=OpenApiPathItem { + operations={get: OpenApiOperation { + type=get, + tags=[Volumes], + summary=List Snapshots, + description=List all snapshots for a specific volume within an app. +, + operationId=Volumes_list_snapshots, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/parameters/1, + component=OpenApiParameter { + name=volume_id, + location=path, + description=Volume ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/parameters/1, + node={name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/responses/200, + component=OpenApiResponse { + description=OK, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=array, + items=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/responses/200/content/application/json/schema/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/VolumeSnapshot, + name=VolumeSnapshot, + node={$ref: #/components/schemas/VolumeSnapshot}, + }, + node={$ref: #/components/schemas/VolumeSnapshot}, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/responses/200/content/application/json/schema, + node={type: array, items: {$ref: #/components/schemas/VolumeSnapshot}}, + }, + }, + encoding={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/responses/200/content/application/json, + node={schema: {type: array, items: {$ref: #/components/schemas/VolumeSnapshot}}}, + }}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/get/responses/200, + node={description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/VolumeSnapshot}}}}}, + }, + }}, + }, post: OpenApiOperation { + type=post, + tags=[Volumes], + summary=Create Snapshot, + description=Create a snapshot for a specific volume within an app. +, + operationId=createVolumeSnapshot, + parameters=[OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/parameters/0, + component=OpenApiParameter { + name=app_name, + location=path, + description=Fly App Name, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/parameters/0/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/parameters/0/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/parameters/0, + node={name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, + }, + }, OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/parameters/1, + component=OpenApiParameter { + name=volume_id, + location=path, + description=Volume ID, + required=true, + schema=OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/parameters/1/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/parameters/1/schema, + node={type: string}, + }, + }, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/parameters/1, + node={name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}, + }, + }], + responses={200: OpenApiComponentOrRef { + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/responses/200, + component=OpenApiResponse { + description=OK, + content={}, + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots/post/responses/200, + node={description: OK, content: {}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//apps/{app_name}/volumes/{volume_id}/snapshots, + node={get: {tags: [Volumes], summary: List Snapshots, description: List all snapshots for a specific volume within an app. +, operationId: Volumes_list_snapshots, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/VolumeSnapshot}}}}}}}, post: {tags: [Volumes], summary: Create Snapshot, description: Create a snapshot for a specific volume within an app. +, operationId: createVolumeSnapshot, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, + }, + }, /tokens/kms: OpenApiComponentOrRef { + ref=#/paths//tokens/kms, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Tokens], + summary=Request a Petsem token for accessing KMS, + description=This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource., + operationId=Tokens_request_Kms, + parameters=[], + responses={200: OpenApiComponentOrRef { + ref=#/paths//tokens/kms/post/responses/200, + component=OpenApiResponse { + description=KMS token, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//tokens/kms/post/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//tokens/kms/post/responses/200/content/application/json/schema, + node={type: string}, + }, + }, + encoding={}, + ref=#/paths//tokens/kms/post/responses/200/content/application/json, + node={schema: {type: string}}, + }}, + ref=#/paths//tokens/kms/post/responses/200, + node={description: KMS token, content: {application/json: {schema: {type: string}}}}, + }, + }}, + }}, + parameters=[], + ref=#/paths//tokens/kms, + node={post: {tags: [Tokens], summary: Request a Petsem token for accessing KMS, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource., operationId: Tokens_request_Kms, responses: {200: {description: KMS token, content: {application/json: {schema: {type: string}}}}}}}, + }, + }, /tokens/oidc: OpenApiComponentOrRef { + ref=#/paths//tokens/oidc, + component=OpenApiPathItem { + operations={post: OpenApiOperation { + type=post, + tags=[Tokens], + summary=Request an OIDC token, + description=Request an Open ID Connect token for your machine. Customize the audience claim with the `aud` parameter. This returns a JWT token. Learn more about [using OpenID Connect](/docs/reference/openid-connect/) on Fly.io. +, + operationId=Tokens_request_OIDC, + parameters=[], + requestBody=OpenApiComponentOrRef { + ref=#/paths//tokens/oidc/post/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//tokens/oidc/post/requestBody/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/CreateOIDCTokenRequest, + name=CreateOIDCTokenRequest, + node={$ref: #/components/schemas/CreateOIDCTokenRequest}, + }, + node={$ref: #/components/schemas/CreateOIDCTokenRequest}, + }, + encoding={}, + ref=#/paths//tokens/oidc/post/requestBody/content/application/json, + node={schema: {$ref: #/components/schemas/CreateOIDCTokenRequest}}, + }}, + description=Optional request body, + required=true, + ref=#/paths//tokens/oidc/post/requestBody, + node={description: Optional request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateOIDCTokenRequest}}}, required: true}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//tokens/oidc/post/responses/200, + component=OpenApiResponse { + description=OIDC token, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//tokens/oidc/post/responses/200/content/application/json/schema, + component=OpenApiSchema { + type=string, + ref=#/paths//tokens/oidc/post/responses/200/content/application/json/schema, + node={type: string}, + }, + }, + encoding={}, + ref=#/paths//tokens/oidc/post/responses/200/content/application/json, + node={schema: {type: string}}, + }}, + ref=#/paths//tokens/oidc/post/responses/200, + node={description: OIDC token, content: {application/json: {schema: {type: string}}}}, + }, + }, 400: OpenApiComponentOrRef { + ref=#/paths//tokens/oidc/post/responses/400, + component=OpenApiResponse { + description=Bad Request, + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//tokens/oidc/post/responses/400/content/application/json/schema, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ErrorResponse, + name=ErrorResponse, + node={$ref: #/components/schemas/ErrorResponse}, + }, + node={$ref: #/components/schemas/ErrorResponse}, + }, + encoding={}, + ref=#/paths//tokens/oidc/post/responses/400/content/application/json, + node={schema: {$ref: #/components/schemas/ErrorResponse}}, + }}, + ref=#/paths//tokens/oidc/post/responses/400, + node={description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}, + }, + }}, + extensions={x-codegen-request-body-name: request}, + }}, + parameters=[], + ref=#/paths//tokens/oidc, + node={post: {tags: [Tokens], summary: Request an OIDC token, description: Request an Open ID Connect token for your machine. Customize the audience claim with the `aud` parameter. This returns a JWT token. Learn more about [using OpenID Connect](/docs/reference/openid-connect/) on Fly.io. +, operationId: Tokens_request_OIDC, requestBody: {description: Optional request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateOIDCTokenRequest}}}, required: true}, responses: {200: {description: OIDC token, content: {application/json: {schema: {type: string}}}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, + }, + }}, + components=OpenApiComponents { + schemas={App: OpenApiSchema { + name=App, + type=object, + properties={id: OpenApiComponentOrRef { + ref=#/components/schemas/App/properties/id, + component=OpenApiSchema { + name=id, + type=string, + ref=#/components/schemas/App/properties/id, + node={type: string}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/App/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/App/properties/name, + node={type: string}, + }, + }, organization: OpenApiComponentOrRef { + ref=#/components/schemas/App/properties/organization, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Organization, + name=Organization, + node={$ref: #/components/schemas/Organization}, + }, + node={$ref: #/components/schemas/Organization}, + }, status: OpenApiComponentOrRef { + ref=#/components/schemas/App/properties/status, + component=OpenApiSchema { + name=status, + type=string, + ref=#/components/schemas/App/properties/status, + node={type: string}, + }, + }}, + ref=#/components/schemas/App, + node={type: object, properties: {id: {type: string}, name: {type: string}, organization: {$ref: #/components/schemas/Organization}, status: {type: string}}}, + }, CheckStatus: OpenApiSchema { + name=CheckStatus, + type=object, + properties={name: OpenApiComponentOrRef { + ref=#/components/schemas/CheckStatus/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/CheckStatus/properties/name, + node={type: string}, + }, + }, output: OpenApiComponentOrRef { + ref=#/components/schemas/CheckStatus/properties/output, + component=OpenApiSchema { + name=output, + type=string, + ref=#/components/schemas/CheckStatus/properties/output, + node={type: string}, + }, + }, status: OpenApiComponentOrRef { + ref=#/components/schemas/CheckStatus/properties/status, + component=OpenApiSchema { + name=status, + type=string, + ref=#/components/schemas/CheckStatus/properties/status, + node={type: string}, + }, + }, updated_at: OpenApiComponentOrRef { + ref=#/components/schemas/CheckStatus/properties/updated_at, + component=OpenApiSchema { + name=updated_at, + type=string, + ref=#/components/schemas/CheckStatus/properties/updated_at, + node={type: string}, + }, + }}, + ref=#/components/schemas/CheckStatus, + node={type: object, properties: {name: {type: string}, output: {type: string}, status: {type: string}, updated_at: {type: string}}}, + }, CreateAppRequest: OpenApiSchema { + name=CreateAppRequest, + type=object, + properties={app_name: OpenApiComponentOrRef { + ref=#/components/schemas/CreateAppRequest/properties/app_name, + component=OpenApiSchema { + name=app_name, + type=string, + ref=#/components/schemas/CreateAppRequest/properties/app_name, + node={type: string}, + }, + }, enable_subdomains: OpenApiComponentOrRef { + ref=#/components/schemas/CreateAppRequest/properties/enable_subdomains, + component=OpenApiSchema { + name=enable_subdomains, + type=boolean, + ref=#/components/schemas/CreateAppRequest/properties/enable_subdomains, + node={type: boolean}, + }, + }, network: OpenApiComponentOrRef { + ref=#/components/schemas/CreateAppRequest/properties/network, + component=OpenApiSchema { + name=network, + type=string, + ref=#/components/schemas/CreateAppRequest/properties/network, + node={type: string}, + }, + }, org_slug: OpenApiComponentOrRef { + ref=#/components/schemas/CreateAppRequest/properties/org_slug, + component=OpenApiSchema { + name=org_slug, + type=string, + ref=#/components/schemas/CreateAppRequest/properties/org_slug, + node={type: string}, + }, + }}, + ref=#/components/schemas/CreateAppRequest, + node={type: object, properties: {app_name: {type: string}, enable_subdomains: {type: boolean}, network: {type: string}, org_slug: {type: string}}}, + }, CreateLeaseRequest: OpenApiSchema { + name=CreateLeaseRequest, + type=object, + properties={description: OpenApiComponentOrRef { + ref=#/components/schemas/CreateLeaseRequest/properties/description, + component=OpenApiSchema { + name=description, + type=string, + ref=#/components/schemas/CreateLeaseRequest/properties/description, + node={type: string}, + }, + }, ttl: OpenApiComponentOrRef { + ref=#/components/schemas/CreateLeaseRequest/properties/ttl, + component=OpenApiSchema { + name=ttl, + type=integer, + description=seconds lease will be valid, + ref=#/components/schemas/CreateLeaseRequest/properties/ttl, + node={type: integer, description: seconds lease will be valid}, + }, + }}, + ref=#/components/schemas/CreateLeaseRequest, + node={type: object, properties: {description: {type: string}, ttl: {type: integer, description: seconds lease will be valid}}}, + }, CreateMachineRequest: OpenApiSchema { + name=CreateMachineRequest, + type=object, + properties={config: OpenApiComponentOrRef { + ref=#/components/schemas/CreateMachineRequest/properties/config, + component=OpenApiSchema { + name=config, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/CreateMachineRequest/properties/config/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineConfig, + name=fly.MachineConfig, + node={$ref: #/components/schemas/fly.MachineConfig}, + }, + node={$ref: #/components/schemas/fly.MachineConfig}, + }], + description=An object defining the Machine configuration, + ref=#/components/schemas/CreateMachineRequest/properties/config, + node={type: object, description: An object defining the Machine configuration, allOf: [{$ref: #/components/schemas/fly.MachineConfig}]}, + }, + }, lease_ttl: OpenApiComponentOrRef { + ref=#/components/schemas/CreateMachineRequest/properties/lease_ttl, + component=OpenApiSchema { + name=lease_ttl, + type=integer, + ref=#/components/schemas/CreateMachineRequest/properties/lease_ttl, + node={type: integer}, + }, + }, lsvd: OpenApiComponentOrRef { + ref=#/components/schemas/CreateMachineRequest/properties/lsvd, + component=OpenApiSchema { + name=lsvd, + type=boolean, + ref=#/components/schemas/CreateMachineRequest/properties/lsvd, + node={type: boolean}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/CreateMachineRequest/properties/name, + component=OpenApiSchema { + name=name, + type=string, + description=Unique name for this Machine. If omitted, one is generated for you, + ref=#/components/schemas/CreateMachineRequest/properties/name, + node={type: string, description: Unique name for this Machine. If omitted, one is generated for you}, + }, + }, region: OpenApiComponentOrRef { + ref=#/components/schemas/CreateMachineRequest/properties/region, + component=OpenApiSchema { + name=region, + type=string, + description=The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you)., + ref=#/components/schemas/CreateMachineRequest/properties/region, + node={type: string, description: The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).}, + }, + }, skip_launch: OpenApiComponentOrRef { + ref=#/components/schemas/CreateMachineRequest/properties/skip_launch, + component=OpenApiSchema { + name=skip_launch, + type=boolean, + ref=#/components/schemas/CreateMachineRequest/properties/skip_launch, + node={type: boolean}, + }, + }, skip_service_registration: OpenApiComponentOrRef { + ref=#/components/schemas/CreateMachineRequest/properties/skip_service_registration, + component=OpenApiSchema { + name=skip_service_registration, + type=boolean, + ref=#/components/schemas/CreateMachineRequest/properties/skip_service_registration, + node={type: boolean}, + }, + }}, + ref=#/components/schemas/CreateMachineRequest, + node={type: object, properties: {config: {type: object, description: An object defining the Machine configuration, allOf: [{$ref: #/components/schemas/fly.MachineConfig}]}, lease_ttl: {type: integer}, lsvd: {type: boolean}, name: {type: string, description: Unique name for this Machine. If omitted, one is generated for you}, region: {type: string, description: The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).}, skip_launch: {type: boolean}, skip_service_registration: {type: boolean}}}, + }, CreateOIDCTokenRequest: OpenApiSchema { + name=CreateOIDCTokenRequest, + type=object, + properties={aud: OpenApiComponentOrRef { + ref=#/components/schemas/CreateOIDCTokenRequest/properties/aud, + component=OpenApiSchema { + name=aud, + type=string, + example=https://fly.io/org-slug, + ref=#/components/schemas/CreateOIDCTokenRequest/properties/aud, + node={type: string, example: https://fly.io/org-slug}, + }, + }, aws_principal_tags: OpenApiComponentOrRef { + ref=#/components/schemas/CreateOIDCTokenRequest/properties/aws_principal_tags, + component=OpenApiSchema { + name=aws_principal_tags, + type=boolean, + ref=#/components/schemas/CreateOIDCTokenRequest/properties/aws_principal_tags, + node={type: boolean}, + }, + }}, + description=Optional parameters, + ref=#/components/schemas/CreateOIDCTokenRequest, + node={type: object, properties: {aud: {type: string, example: https://fly.io/org-slug}, aws_principal_tags: {type: boolean}}, description: Optional parameters}, + }, CreateSecretRequest: OpenApiSchema { + name=CreateSecretRequest, + type=object, + properties={value: OpenApiComponentOrRef { + ref=#/components/schemas/CreateSecretRequest/properties/value, + component=OpenApiSchema { + name=value, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/CreateSecretRequest/properties/value/items, + component=OpenApiSchema { + name=items, + type=integer, + ref=#/components/schemas/CreateSecretRequest/properties/value/items, + node={type: integer}, + }, + }, + ref=#/components/schemas/CreateSecretRequest/properties/value, + node={type: array, items: {type: integer}}, + }, + }}, + ref=#/components/schemas/CreateSecretRequest, + node={type: object, properties: {value: {type: array, items: {type: integer}}}}, + }, CreateVolumeRequest: OpenApiSchema { + name=CreateVolumeRequest, + type=object, + properties={compute: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/compute, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineGuest, + name=fly.MachineGuest, + node={$ref: #/components/schemas/fly.MachineGuest}, + }, + node={$ref: #/components/schemas/fly.MachineGuest}, + }, compute_image: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/compute_image, + component=OpenApiSchema { + name=compute_image, + type=string, + ref=#/components/schemas/CreateVolumeRequest/properties/compute_image, + node={type: string}, + }, + }, encrypted: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/encrypted, + component=OpenApiSchema { + name=encrypted, + type=boolean, + ref=#/components/schemas/CreateVolumeRequest/properties/encrypted, + node={type: boolean}, + }, + }, fstype: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/fstype, + component=OpenApiSchema { + name=fstype, + type=string, + ref=#/components/schemas/CreateVolumeRequest/properties/fstype, + node={type: string}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/CreateVolumeRequest/properties/name, + node={type: string}, + }, + }, region: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/region, + component=OpenApiSchema { + name=region, + type=string, + ref=#/components/schemas/CreateVolumeRequest/properties/region, + node={type: string}, + }, + }, require_unique_zone: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/require_unique_zone, + component=OpenApiSchema { + name=require_unique_zone, + type=boolean, + ref=#/components/schemas/CreateVolumeRequest/properties/require_unique_zone, + node={type: boolean}, + }, + }, size_gb: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/size_gb, + component=OpenApiSchema { + name=size_gb, + type=integer, + ref=#/components/schemas/CreateVolumeRequest/properties/size_gb, + node={type: integer}, + }, + }, snapshot_id: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/snapshot_id, + component=OpenApiSchema { + name=snapshot_id, + type=string, + description=restore from snapshot, + ref=#/components/schemas/CreateVolumeRequest/properties/snapshot_id, + node={type: string, description: restore from snapshot}, + }, + }, snapshot_retention: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/snapshot_retention, + component=OpenApiSchema { + name=snapshot_retention, + type=integer, + ref=#/components/schemas/CreateVolumeRequest/properties/snapshot_retention, + node={type: integer}, + }, + }, source_volume_id: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/source_volume_id, + component=OpenApiSchema { + name=source_volume_id, + type=string, + description=fork from remote volume, + ref=#/components/schemas/CreateVolumeRequest/properties/source_volume_id, + node={type: string, description: fork from remote volume}, + }, + }, unique_zone_app_wide: OpenApiComponentOrRef { + ref=#/components/schemas/CreateVolumeRequest/properties/unique_zone_app_wide, + component=OpenApiSchema { + name=unique_zone_app_wide, + type=boolean, + ref=#/components/schemas/CreateVolumeRequest/properties/unique_zone_app_wide, + node={type: boolean}, + }, + }}, + ref=#/components/schemas/CreateVolumeRequest, + node={type: object, properties: {compute: {$ref: #/components/schemas/fly.MachineGuest}, compute_image: {type: string}, encrypted: {type: boolean}, fstype: {type: string}, name: {type: string}, region: {type: string}, require_unique_zone: {type: boolean}, size_gb: {type: integer}, snapshot_id: {type: string, description: restore from snapshot}, snapshot_retention: {type: integer}, source_volume_id: {type: string, description: fork from remote volume}, unique_zone_app_wide: {type: boolean}}}, + }, ErrorResponse: OpenApiSchema { + name=ErrorResponse, + type=object, + properties={details: OpenApiComponentOrRef { + ref=#/components/schemas/ErrorResponse/properties/details, + component=OpenApiSchema { + name=details, + type=object, + description=Deprecated, + ref=#/components/schemas/ErrorResponse/properties/details, + node={type: object, description: Deprecated}, + }, + }, error: OpenApiComponentOrRef { + ref=#/components/schemas/ErrorResponse/properties/error, + component=OpenApiSchema { + name=error, + type=string, + ref=#/components/schemas/ErrorResponse/properties/error, + node={type: string}, + }, + }, status: OpenApiComponentOrRef { + ref=#/components/schemas/ErrorResponse/properties/status, + reference=OpenApiSchemaReference { + ref=#/components/schemas/main.statusCode, + name=main.statusCode, + node={$ref: #/components/schemas/main.statusCode}, + }, + node={$ref: #/components/schemas/main.statusCode}, + }}, + ref=#/components/schemas/ErrorResponse, + node={type: object, properties: {details: {type: object, description: Deprecated}, error: {type: string}, status: {$ref: #/components/schemas/main.statusCode}}}, + }, ExtendVolumeRequest: OpenApiSchema { + name=ExtendVolumeRequest, + type=object, + properties={size_gb: OpenApiComponentOrRef { + ref=#/components/schemas/ExtendVolumeRequest/properties/size_gb, + component=OpenApiSchema { + name=size_gb, + type=integer, + ref=#/components/schemas/ExtendVolumeRequest/properties/size_gb, + node={type: integer}, + }, + }}, + ref=#/components/schemas/ExtendVolumeRequest, + node={type: object, properties: {size_gb: {type: integer}}}, + }, ExtendVolumeResponse: OpenApiSchema { + name=ExtendVolumeResponse, + type=object, + properties={needs_restart: OpenApiComponentOrRef { + ref=#/components/schemas/ExtendVolumeResponse/properties/needs_restart, + component=OpenApiSchema { + name=needs_restart, + type=boolean, + ref=#/components/schemas/ExtendVolumeResponse/properties/needs_restart, + node={type: boolean}, + }, + }, volume: OpenApiComponentOrRef { + ref=#/components/schemas/ExtendVolumeResponse/properties/volume, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Volume, + name=Volume, + node={$ref: #/components/schemas/Volume}, + }, + node={$ref: #/components/schemas/Volume}, + }}, + ref=#/components/schemas/ExtendVolumeResponse, + node={type: object, properties: {needs_restart: {type: boolean}, volume: {$ref: #/components/schemas/Volume}}}, + }, ImageRef: OpenApiSchema { + name=ImageRef, + type=object, + properties={digest: OpenApiComponentOrRef { + ref=#/components/schemas/ImageRef/properties/digest, + component=OpenApiSchema { + name=digest, + type=string, + ref=#/components/schemas/ImageRef/properties/digest, + node={type: string}, + }, + }, labels: OpenApiComponentOrRef { + ref=#/components/schemas/ImageRef/properties/labels, + component=OpenApiSchema { + name=labels, + type=object, + additionalProperties=OpenApiAdditionalProperties { + schema=OpenApiComponentOrRef { + ref=#/components/schemas/ImageRef/properties/labels/additionalProperties, + component=OpenApiSchema { + name=additionalProperties, + type=string, + ref=#/components/schemas/ImageRef/properties/labels/additionalProperties, + node={type: string}, + }, + }, + }, + ref=#/components/schemas/ImageRef/properties/labels, + node={type: object, additionalProperties: {type: string}}, + }, + }, registry: OpenApiComponentOrRef { + ref=#/components/schemas/ImageRef/properties/registry, + component=OpenApiSchema { + name=registry, + type=string, + ref=#/components/schemas/ImageRef/properties/registry, + node={type: string}, + }, + }, repository: OpenApiComponentOrRef { + ref=#/components/schemas/ImageRef/properties/repository, + component=OpenApiSchema { + name=repository, + type=string, + ref=#/components/schemas/ImageRef/properties/repository, + node={type: string}, + }, + }, tag: OpenApiComponentOrRef { + ref=#/components/schemas/ImageRef/properties/tag, + component=OpenApiSchema { + name=tag, + type=string, + ref=#/components/schemas/ImageRef/properties/tag, + node={type: string}, + }, + }}, + ref=#/components/schemas/ImageRef, + node={type: object, properties: {digest: {type: string}, labels: {type: object, additionalProperties: {type: string}}, registry: {type: string}, repository: {type: string}, tag: {type: string}}}, + }, Lease: OpenApiSchema { + name=Lease, + type=object, + properties={description: OpenApiComponentOrRef { + ref=#/components/schemas/Lease/properties/description, + component=OpenApiSchema { + name=description, + type=string, + description=Description or reason for the Lease., + ref=#/components/schemas/Lease/properties/description, + node={type: string, description: Description or reason for the Lease.}, + }, + }, expires_at: OpenApiComponentOrRef { + ref=#/components/schemas/Lease/properties/expires_at, + component=OpenApiSchema { + name=expires_at, + type=integer, + description=ExpiresAt is the unix timestamp in UTC to denote when the Lease will no longer be valid., + ref=#/components/schemas/Lease/properties/expires_at, + node={type: integer, description: ExpiresAt is the unix timestamp in UTC to denote when the Lease will no longer be valid.}, + }, + }, nonce: OpenApiComponentOrRef { + ref=#/components/schemas/Lease/properties/nonce, + component=OpenApiSchema { + name=nonce, + type=string, + description=Nonce is the unique ID autogenerated and associated with the Lease., + ref=#/components/schemas/Lease/properties/nonce, + node={type: string, description: Nonce is the unique ID autogenerated and associated with the Lease.}, + }, + }, owner: OpenApiComponentOrRef { + ref=#/components/schemas/Lease/properties/owner, + component=OpenApiSchema { + name=owner, + type=string, + description=Owner is the user identifier which acquired the Lease., + ref=#/components/schemas/Lease/properties/owner, + node={type: string, description: Owner is the user identifier which acquired the Lease.}, + }, + }, version: OpenApiComponentOrRef { + ref=#/components/schemas/Lease/properties/version, + component=OpenApiSchema { + name=version, + type=string, + description=Machine version, + ref=#/components/schemas/Lease/properties/version, + node={type: string, description: Machine version}, + }, + }}, + ref=#/components/schemas/Lease, + node={type: object, properties: {description: {type: string, description: Description or reason for the Lease.}, expires_at: {type: integer, description: ExpiresAt is the unix timestamp in UTC to denote when the Lease will no longer be valid.}, nonce: {type: string, description: Nonce is the unique ID autogenerated and associated with the Lease.}, owner: {type: string, description: Owner is the user identifier which acquired the Lease.}, version: {type: string, description: Machine version}}}, + }, ListApp: OpenApiSchema { + name=ListApp, + type=object, + properties={id: OpenApiComponentOrRef { + ref=#/components/schemas/ListApp/properties/id, + component=OpenApiSchema { + name=id, + type=string, + ref=#/components/schemas/ListApp/properties/id, + node={type: string}, + }, + }, machine_count: OpenApiComponentOrRef { + ref=#/components/schemas/ListApp/properties/machine_count, + component=OpenApiSchema { + name=machine_count, + type=integer, + ref=#/components/schemas/ListApp/properties/machine_count, + node={type: integer}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/ListApp/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/ListApp/properties/name, + node={type: string}, + }, + }, network: OpenApiComponentOrRef { + ref=#/components/schemas/ListApp/properties/network, + component=OpenApiSchema { + name=network, + type=object, + ref=#/components/schemas/ListApp/properties/network, + node={type: object}, + }, + }}, + ref=#/components/schemas/ListApp, + node={type: object, properties: {id: {type: string}, machine_count: {type: integer}, name: {type: string}, network: {type: object}}}, + }, ListAppsResponse: OpenApiSchema { + name=ListAppsResponse, + type=object, + properties={apps: OpenApiComponentOrRef { + ref=#/components/schemas/ListAppsResponse/properties/apps, + component=OpenApiSchema { + name=apps, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/ListAppsResponse/properties/apps/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ListApp, + name=ListApp, + node={$ref: #/components/schemas/ListApp}, + }, + node={$ref: #/components/schemas/ListApp}, + }, + ref=#/components/schemas/ListAppsResponse/properties/apps, + node={type: array, items: {$ref: #/components/schemas/ListApp}}, + }, + }, total_apps: OpenApiComponentOrRef { + ref=#/components/schemas/ListAppsResponse/properties/total_apps, + component=OpenApiSchema { + name=total_apps, + type=integer, + ref=#/components/schemas/ListAppsResponse/properties/total_apps, + node={type: integer}, + }, + }}, + ref=#/components/schemas/ListAppsResponse, + node={type: object, properties: {apps: {type: array, items: {$ref: #/components/schemas/ListApp}}, total_apps: {type: integer}}}, + }, ListSecret: OpenApiSchema { + name=ListSecret, + type=object, + properties={label: OpenApiComponentOrRef { + ref=#/components/schemas/ListSecret/properties/label, + component=OpenApiSchema { + name=label, + type=string, + ref=#/components/schemas/ListSecret/properties/label, + node={type: string}, + }, + }, publickey: OpenApiComponentOrRef { + ref=#/components/schemas/ListSecret/properties/publickey, + component=OpenApiSchema { + name=publickey, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/ListSecret/properties/publickey/items, + component=OpenApiSchema { + name=items, + type=integer, + ref=#/components/schemas/ListSecret/properties/publickey/items, + node={type: integer}, + }, + }, + ref=#/components/schemas/ListSecret/properties/publickey, + node={type: array, items: {type: integer}}, + }, + }, type: OpenApiComponentOrRef { + ref=#/components/schemas/ListSecret/properties/type, + component=OpenApiSchema { + name=type, + type=string, + ref=#/components/schemas/ListSecret/properties/type, + node={type: string}, + }, + }}, + ref=#/components/schemas/ListSecret, + node={type: object, properties: {label: {type: string}, publickey: {type: array, items: {type: integer}}, type: {type: string}}}, + }, ListenSocket: OpenApiSchema { + name=ListenSocket, + type=object, + properties={address: OpenApiComponentOrRef { + ref=#/components/schemas/ListenSocket/properties/address, + component=OpenApiSchema { + name=address, + type=string, + ref=#/components/schemas/ListenSocket/properties/address, + node={type: string}, + }, + }, proto: OpenApiComponentOrRef { + ref=#/components/schemas/ListenSocket/properties/proto, + component=OpenApiSchema { + name=proto, + type=string, + ref=#/components/schemas/ListenSocket/properties/proto, + node={type: string}, + }, + }}, + ref=#/components/schemas/ListenSocket, + node={type: object, properties: {address: {type: string}, proto: {type: string}}}, + }, Machine: OpenApiSchema { + name=Machine, + type=object, + properties={checks: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/checks, + component=OpenApiSchema { + name=checks, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/checks/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/CheckStatus, + name=CheckStatus, + node={$ref: #/components/schemas/CheckStatus}, + }, + node={$ref: #/components/schemas/CheckStatus}, + }, + ref=#/components/schemas/Machine/properties/checks, + node={type: array, items: {$ref: #/components/schemas/CheckStatus}}, + }, + }, config: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/config, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineConfig, + name=fly.MachineConfig, + node={$ref: #/components/schemas/fly.MachineConfig}, + }, + node={$ref: #/components/schemas/fly.MachineConfig}, + }, created_at: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/created_at, + component=OpenApiSchema { + name=created_at, + type=string, + ref=#/components/schemas/Machine/properties/created_at, + node={type: string}, + }, + }, events: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/events, + component=OpenApiSchema { + name=events, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/events/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/MachineEvent, + name=MachineEvent, + node={$ref: #/components/schemas/MachineEvent}, + }, + node={$ref: #/components/schemas/MachineEvent}, + }, + ref=#/components/schemas/Machine/properties/events, + node={type: array, items: {$ref: #/components/schemas/MachineEvent}}, + }, + }, host_status: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/host_status, + component=OpenApiSchema { + name=host_status, + type=string, + enumValues={ok, unknown, unreachable}, + ref=#/components/schemas/Machine/properties/host_status, + node={type: string, enum: [ok, unknown, unreachable]}, + }, + }, id: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/id, + component=OpenApiSchema { + name=id, + type=string, + ref=#/components/schemas/Machine/properties/id, + node={type: string}, + }, + }, image_ref: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/image_ref, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ImageRef, + name=ImageRef, + node={$ref: #/components/schemas/ImageRef}, + }, + node={$ref: #/components/schemas/ImageRef}, + }, incomplete_config: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/incomplete_config, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineConfig, + name=fly.MachineConfig, + node={$ref: #/components/schemas/fly.MachineConfig}, + }, + node={$ref: #/components/schemas/fly.MachineConfig}, + }, instance_id: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/instance_id, + component=OpenApiSchema { + name=instance_id, + type=string, + description=InstanceID is unique for each version of the machine, + ref=#/components/schemas/Machine/properties/instance_id, + node={type: string, description: InstanceID is unique for each version of the machine}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/Machine/properties/name, + node={type: string}, + }, + }, nonce: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/nonce, + component=OpenApiSchema { + name=nonce, + type=string, + description=Nonce is only every returned on machine creation if a lease_duration was provided., + ref=#/components/schemas/Machine/properties/nonce, + node={type: string, description: Nonce is only every returned on machine creation if a lease_duration was provided.}, + }, + }, private_ip: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/private_ip, + component=OpenApiSchema { + name=private_ip, + type=string, + description=PrivateIP is the internal 6PN address of the machine., + ref=#/components/schemas/Machine/properties/private_ip, + node={type: string, description: PrivateIP is the internal 6PN address of the machine.}, + }, + }, region: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/region, + component=OpenApiSchema { + name=region, + type=string, + ref=#/components/schemas/Machine/properties/region, + node={type: string}, + }, + }, state: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/state, + component=OpenApiSchema { + name=state, + type=string, + ref=#/components/schemas/Machine/properties/state, + node={type: string}, + }, + }, updated_at: OpenApiComponentOrRef { + ref=#/components/schemas/Machine/properties/updated_at, + component=OpenApiSchema { + name=updated_at, + type=string, + ref=#/components/schemas/Machine/properties/updated_at, + node={type: string}, + }, + }}, + ref=#/components/schemas/Machine, + node={type: object, properties: {checks: {type: array, items: {$ref: #/components/schemas/CheckStatus}}, config: {$ref: #/components/schemas/fly.MachineConfig}, created_at: {type: string}, events: {type: array, items: {$ref: #/components/schemas/MachineEvent}}, host_status: {type: string, enum: [ok, unknown, unreachable]}, id: {type: string}, image_ref: {$ref: #/components/schemas/ImageRef}, incomplete_config: {$ref: #/components/schemas/fly.MachineConfig}, instance_id: {type: string, description: InstanceID is unique for each version of the machine}, name: {type: string}, nonce: {type: string, description: Nonce is only every returned on machine creation if a lease_duration was provided.}, private_ip: {type: string, description: PrivateIP is the internal 6PN address of the machine.}, region: {type: string}, state: {type: string}, updated_at: {type: string}}}, + }, MachineEvent: OpenApiSchema { + name=MachineEvent, + type=object, + properties={id: OpenApiComponentOrRef { + ref=#/components/schemas/MachineEvent/properties/id, + component=OpenApiSchema { + name=id, + type=string, + ref=#/components/schemas/MachineEvent/properties/id, + node={type: string}, + }, + }, request: OpenApiComponentOrRef { + ref=#/components/schemas/MachineEvent/properties/request, + component=OpenApiSchema { + name=request, + type=object, + ref=#/components/schemas/MachineEvent/properties/request, + node={type: object}, + }, + }, source: OpenApiComponentOrRef { + ref=#/components/schemas/MachineEvent/properties/source, + component=OpenApiSchema { + name=source, + type=string, + ref=#/components/schemas/MachineEvent/properties/source, + node={type: string}, + }, + }, status: OpenApiComponentOrRef { + ref=#/components/schemas/MachineEvent/properties/status, + component=OpenApiSchema { + name=status, + type=string, + ref=#/components/schemas/MachineEvent/properties/status, + node={type: string}, + }, + }, timestamp: OpenApiComponentOrRef { + ref=#/components/schemas/MachineEvent/properties/timestamp, + component=OpenApiSchema { + name=timestamp, + type=integer, + ref=#/components/schemas/MachineEvent/properties/timestamp, + node={type: integer}, + }, + }, type: OpenApiComponentOrRef { + ref=#/components/schemas/MachineEvent/properties/type, + component=OpenApiSchema { + name=type, + type=string, + ref=#/components/schemas/MachineEvent/properties/type, + node={type: string}, + }, + }}, + ref=#/components/schemas/MachineEvent, + node={type: object, properties: {id: {type: string}, request: {type: object}, source: {type: string}, status: {type: string}, timestamp: {type: integer}, type: {type: string}}}, + }, MachineExecRequest: OpenApiSchema { + name=MachineExecRequest, + type=object, + properties={cmd: OpenApiComponentOrRef { + ref=#/components/schemas/MachineExecRequest/properties/cmd, + component=OpenApiSchema { + name=cmd, + type=string, + description=Deprecated: use Command instead, + ref=#/components/schemas/MachineExecRequest/properties/cmd, + node={type: string, description: Deprecated: use Command instead}, + }, + }, command: OpenApiComponentOrRef { + ref=#/components/schemas/MachineExecRequest/properties/command, + component=OpenApiSchema { + name=command, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/MachineExecRequest/properties/command/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/MachineExecRequest/properties/command/items, + node={type: string}, + }, + }, + ref=#/components/schemas/MachineExecRequest/properties/command, + node={type: array, items: {type: string}}, + }, + }, container: OpenApiComponentOrRef { + ref=#/components/schemas/MachineExecRequest/properties/container, + component=OpenApiSchema { + name=container, + type=string, + ref=#/components/schemas/MachineExecRequest/properties/container, + node={type: string}, + }, + }, stdin: OpenApiComponentOrRef { + ref=#/components/schemas/MachineExecRequest/properties/stdin, + component=OpenApiSchema { + name=stdin, + type=string, + ref=#/components/schemas/MachineExecRequest/properties/stdin, + node={type: string}, + }, + }, timeout: OpenApiComponentOrRef { + ref=#/components/schemas/MachineExecRequest/properties/timeout, + component=OpenApiSchema { + name=timeout, + type=integer, + ref=#/components/schemas/MachineExecRequest/properties/timeout, + node={type: integer}, + }, + }}, + ref=#/components/schemas/MachineExecRequest, + node={type: object, properties: {cmd: {type: string, description: Deprecated: use Command instead}, command: {type: array, items: {type: string}}, container: {type: string}, stdin: {type: string}, timeout: {type: integer}}}, + }, MachineVersion: OpenApiSchema { + name=MachineVersion, + type=object, + properties={user_config: OpenApiComponentOrRef { + ref=#/components/schemas/MachineVersion/properties/user_config, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineConfig, + name=fly.MachineConfig, + node={$ref: #/components/schemas/fly.MachineConfig}, + }, + node={$ref: #/components/schemas/fly.MachineConfig}, + }, version: OpenApiComponentOrRef { + ref=#/components/schemas/MachineVersion/properties/version, + component=OpenApiSchema { + name=version, + type=string, + ref=#/components/schemas/MachineVersion/properties/version, + node={type: string}, + }, + }}, + ref=#/components/schemas/MachineVersion, + node={type: object, properties: {user_config: {$ref: #/components/schemas/fly.MachineConfig}, version: {type: string}}}, + }, Organization: OpenApiSchema { + name=Organization, + type=object, + properties={name: OpenApiComponentOrRef { + ref=#/components/schemas/Organization/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/Organization/properties/name, + node={type: string}, + }, + }, slug: OpenApiComponentOrRef { + ref=#/components/schemas/Organization/properties/slug, + component=OpenApiSchema { + name=slug, + type=string, + ref=#/components/schemas/Organization/properties/slug, + node={type: string}, + }, + }}, + ref=#/components/schemas/Organization, + node={type: object, properties: {name: {type: string}, slug: {type: string}}}, + }, ProcessStat: OpenApiSchema { + name=ProcessStat, + type=object, + properties={command: OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/command, + component=OpenApiSchema { + name=command, + type=string, + ref=#/components/schemas/ProcessStat/properties/command, + node={type: string}, + }, + }, cpu: OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/cpu, + component=OpenApiSchema { + name=cpu, + type=integer, + ref=#/components/schemas/ProcessStat/properties/cpu, + node={type: integer}, + }, + }, directory: OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/directory, + component=OpenApiSchema { + name=directory, + type=string, + ref=#/components/schemas/ProcessStat/properties/directory, + node={type: string}, + }, + }, listen_sockets: OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/listen_sockets, + component=OpenApiSchema { + name=listen_sockets, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/listen_sockets/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/ListenSocket, + name=ListenSocket, + node={$ref: #/components/schemas/ListenSocket}, + }, + node={$ref: #/components/schemas/ListenSocket}, + }, + ref=#/components/schemas/ProcessStat/properties/listen_sockets, + node={type: array, items: {$ref: #/components/schemas/ListenSocket}}, + }, + }, pid: OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/pid, + component=OpenApiSchema { + name=pid, + type=integer, + ref=#/components/schemas/ProcessStat/properties/pid, + node={type: integer}, + }, + }, rss: OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/rss, + component=OpenApiSchema { + name=rss, + type=integer, + ref=#/components/schemas/ProcessStat/properties/rss, + node={type: integer}, + }, + }, rtime: OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/rtime, + component=OpenApiSchema { + name=rtime, + type=integer, + ref=#/components/schemas/ProcessStat/properties/rtime, + node={type: integer}, + }, + }, stime: OpenApiComponentOrRef { + ref=#/components/schemas/ProcessStat/properties/stime, + component=OpenApiSchema { + name=stime, + type=integer, + ref=#/components/schemas/ProcessStat/properties/stime, + node={type: integer}, + }, + }}, + ref=#/components/schemas/ProcessStat, + node={type: object, properties: {command: {type: string}, cpu: {type: integer}, directory: {type: string}, listen_sockets: {type: array, items: {$ref: #/components/schemas/ListenSocket}}, pid: {type: integer}, rss: {type: integer}, rtime: {type: integer}, stime: {type: integer}}}, + }, SignalRequest: OpenApiSchema { + name=SignalRequest, + type=object, + properties={signal: OpenApiComponentOrRef { + ref=#/components/schemas/SignalRequest/properties/signal, + component=OpenApiSchema { + name=signal, + type=string, + enumValues={SIGABRT, SIGALRM, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGTERM, SIGTRAP, SIGUSR1}, + ref=#/components/schemas/SignalRequest/properties/signal, + node={type: string, enum: [SIGABRT, SIGALRM, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGTERM, SIGTRAP, SIGUSR1]}, + }, + }}, + ref=#/components/schemas/SignalRequest, + node={type: object, properties: {signal: {type: string, enum: [SIGABRT, SIGALRM, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGTERM, SIGTRAP, SIGUSR1]}}}, + }, StopRequest: OpenApiSchema { + name=StopRequest, + type=object, + properties={signal: OpenApiComponentOrRef { + ref=#/components/schemas/StopRequest/properties/signal, + component=OpenApiSchema { + name=signal, + type=string, + ref=#/components/schemas/StopRequest/properties/signal, + node={type: string}, + }, + }, timeout: OpenApiComponentOrRef { + ref=#/components/schemas/StopRequest/properties/timeout, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.Duration, + name=fly.Duration, + node={$ref: #/components/schemas/fly.Duration}, + }, + node={$ref: #/components/schemas/fly.Duration}, + }}, + ref=#/components/schemas/StopRequest, + node={type: object, properties: {signal: {type: string}, timeout: {$ref: #/components/schemas/fly.Duration}}}, + }, UpdateMachineRequest: OpenApiSchema { + name=UpdateMachineRequest, + type=object, + properties={config: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/config, + component=OpenApiSchema { + name=config, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/config/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineConfig, + name=fly.MachineConfig, + node={$ref: #/components/schemas/fly.MachineConfig}, + }, + node={$ref: #/components/schemas/fly.MachineConfig}, + }], + description=An object defining the Machine configuration, + ref=#/components/schemas/UpdateMachineRequest/properties/config, + node={type: object, description: An object defining the Machine configuration, allOf: [{$ref: #/components/schemas/fly.MachineConfig}]}, + }, + }, current_version: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/current_version, + component=OpenApiSchema { + name=current_version, + type=string, + ref=#/components/schemas/UpdateMachineRequest/properties/current_version, + node={type: string}, + }, + }, lease_ttl: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/lease_ttl, + component=OpenApiSchema { + name=lease_ttl, + type=integer, + ref=#/components/schemas/UpdateMachineRequest/properties/lease_ttl, + node={type: integer}, + }, + }, lsvd: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/lsvd, + component=OpenApiSchema { + name=lsvd, + type=boolean, + ref=#/components/schemas/UpdateMachineRequest/properties/lsvd, + node={type: boolean}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/name, + component=OpenApiSchema { + name=name, + type=string, + description=Unique name for this Machine. If omitted, one is generated for you, + ref=#/components/schemas/UpdateMachineRequest/properties/name, + node={type: string, description: Unique name for this Machine. If omitted, one is generated for you}, + }, + }, region: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/region, + component=OpenApiSchema { + name=region, + type=string, + description=The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you)., + ref=#/components/schemas/UpdateMachineRequest/properties/region, + node={type: string, description: The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).}, + }, + }, skip_launch: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/skip_launch, + component=OpenApiSchema { + name=skip_launch, + type=boolean, + ref=#/components/schemas/UpdateMachineRequest/properties/skip_launch, + node={type: boolean}, + }, + }, skip_service_registration: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateMachineRequest/properties/skip_service_registration, + component=OpenApiSchema { + name=skip_service_registration, + type=boolean, + ref=#/components/schemas/UpdateMachineRequest/properties/skip_service_registration, + node={type: boolean}, + }, + }}, + ref=#/components/schemas/UpdateMachineRequest, + node={type: object, properties: {config: {type: object, description: An object defining the Machine configuration, allOf: [{$ref: #/components/schemas/fly.MachineConfig}]}, current_version: {type: string}, lease_ttl: {type: integer}, lsvd: {type: boolean}, name: {type: string, description: Unique name for this Machine. If omitted, one is generated for you}, region: {type: string, description: The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).}, skip_launch: {type: boolean}, skip_service_registration: {type: boolean}}}, + }, UpdateVolumeRequest: OpenApiSchema { + name=UpdateVolumeRequest, + type=object, + properties={auto_backup_enabled: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateVolumeRequest/properties/auto_backup_enabled, + component=OpenApiSchema { + name=auto_backup_enabled, + type=boolean, + ref=#/components/schemas/UpdateVolumeRequest/properties/auto_backup_enabled, + node={type: boolean}, + }, + }, snapshot_retention: OpenApiComponentOrRef { + ref=#/components/schemas/UpdateVolumeRequest/properties/snapshot_retention, + component=OpenApiSchema { + name=snapshot_retention, + type=integer, + ref=#/components/schemas/UpdateVolumeRequest/properties/snapshot_retention, + node={type: integer}, + }, + }}, + ref=#/components/schemas/UpdateVolumeRequest, + node={type: object, properties: {auto_backup_enabled: {type: boolean}, snapshot_retention: {type: integer}}}, + }, Volume: OpenApiSchema { + name=Volume, + type=object, + properties={attached_alloc_id: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/attached_alloc_id, + component=OpenApiSchema { + name=attached_alloc_id, + type=string, + ref=#/components/schemas/Volume/properties/attached_alloc_id, + node={type: string}, + }, + }, attached_machine_id: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/attached_machine_id, + component=OpenApiSchema { + name=attached_machine_id, + type=string, + ref=#/components/schemas/Volume/properties/attached_machine_id, + node={type: string}, + }, + }, auto_backup_enabled: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/auto_backup_enabled, + component=OpenApiSchema { + name=auto_backup_enabled, + type=boolean, + ref=#/components/schemas/Volume/properties/auto_backup_enabled, + node={type: boolean}, + }, + }, block_size: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/block_size, + component=OpenApiSchema { + name=block_size, + type=integer, + ref=#/components/schemas/Volume/properties/block_size, + node={type: integer}, + }, + }, blocks: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/blocks, + component=OpenApiSchema { + name=blocks, + type=integer, + ref=#/components/schemas/Volume/properties/blocks, + node={type: integer}, + }, + }, blocks_avail: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/blocks_avail, + component=OpenApiSchema { + name=blocks_avail, + type=integer, + ref=#/components/schemas/Volume/properties/blocks_avail, + node={type: integer}, + }, + }, blocks_free: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/blocks_free, + component=OpenApiSchema { + name=blocks_free, + type=integer, + ref=#/components/schemas/Volume/properties/blocks_free, + node={type: integer}, + }, + }, created_at: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/created_at, + component=OpenApiSchema { + name=created_at, + type=string, + ref=#/components/schemas/Volume/properties/created_at, + node={type: string}, + }, + }, encrypted: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/encrypted, + component=OpenApiSchema { + name=encrypted, + type=boolean, + ref=#/components/schemas/Volume/properties/encrypted, + node={type: boolean}, + }, + }, fstype: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/fstype, + component=OpenApiSchema { + name=fstype, + type=string, + ref=#/components/schemas/Volume/properties/fstype, + node={type: string}, + }, + }, host_status: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/host_status, + component=OpenApiSchema { + name=host_status, + type=string, + enumValues={ok, unknown, unreachable}, + ref=#/components/schemas/Volume/properties/host_status, + node={type: string, enum: [ok, unknown, unreachable]}, + }, + }, id: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/id, + component=OpenApiSchema { + name=id, + type=string, + ref=#/components/schemas/Volume/properties/id, + node={type: string}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/Volume/properties/name, + node={type: string}, + }, + }, region: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/region, + component=OpenApiSchema { + name=region, + type=string, + ref=#/components/schemas/Volume/properties/region, + node={type: string}, + }, + }, size_gb: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/size_gb, + component=OpenApiSchema { + name=size_gb, + type=integer, + ref=#/components/schemas/Volume/properties/size_gb, + node={type: integer}, + }, + }, snapshot_retention: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/snapshot_retention, + component=OpenApiSchema { + name=snapshot_retention, + type=integer, + ref=#/components/schemas/Volume/properties/snapshot_retention, + node={type: integer}, + }, + }, state: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/state, + component=OpenApiSchema { + name=state, + type=string, + ref=#/components/schemas/Volume/properties/state, + node={type: string}, + }, + }, zone: OpenApiComponentOrRef { + ref=#/components/schemas/Volume/properties/zone, + component=OpenApiSchema { + name=zone, + type=string, + ref=#/components/schemas/Volume/properties/zone, + node={type: string}, + }, + }}, + ref=#/components/schemas/Volume, + node={type: object, properties: {attached_alloc_id: {type: string}, attached_machine_id: {type: string}, auto_backup_enabled: {type: boolean}, block_size: {type: integer}, blocks: {type: integer}, blocks_avail: {type: integer}, blocks_free: {type: integer}, created_at: {type: string}, encrypted: {type: boolean}, fstype: {type: string}, host_status: {type: string, enum: [ok, unknown, unreachable]}, id: {type: string}, name: {type: string}, region: {type: string}, size_gb: {type: integer}, snapshot_retention: {type: integer}, state: {type: string}, zone: {type: string}}}, + }, VolumeSnapshot: OpenApiSchema { + name=VolumeSnapshot, + type=object, + properties={created_at: OpenApiComponentOrRef { + ref=#/components/schemas/VolumeSnapshot/properties/created_at, + component=OpenApiSchema { + name=created_at, + type=string, + ref=#/components/schemas/VolumeSnapshot/properties/created_at, + node={type: string}, + }, + }, digest: OpenApiComponentOrRef { + ref=#/components/schemas/VolumeSnapshot/properties/digest, + component=OpenApiSchema { + name=digest, + type=string, + ref=#/components/schemas/VolumeSnapshot/properties/digest, + node={type: string}, + }, + }, id: OpenApiComponentOrRef { + ref=#/components/schemas/VolumeSnapshot/properties/id, + component=OpenApiSchema { + name=id, + type=string, + ref=#/components/schemas/VolumeSnapshot/properties/id, + node={type: string}, + }, + }, retention_days: OpenApiComponentOrRef { + ref=#/components/schemas/VolumeSnapshot/properties/retention_days, + component=OpenApiSchema { + name=retention_days, + type=integer, + ref=#/components/schemas/VolumeSnapshot/properties/retention_days, + node={type: integer}, + }, + }, size: OpenApiComponentOrRef { + ref=#/components/schemas/VolumeSnapshot/properties/size, + component=OpenApiSchema { + name=size, + type=integer, + ref=#/components/schemas/VolumeSnapshot/properties/size, + node={type: integer}, + }, + }, status: OpenApiComponentOrRef { + ref=#/components/schemas/VolumeSnapshot/properties/status, + component=OpenApiSchema { + name=status, + type=string, + ref=#/components/schemas/VolumeSnapshot/properties/status, + node={type: string}, + }, + }}, + ref=#/components/schemas/VolumeSnapshot, + node={type: object, properties: {created_at: {type: string}, digest: {type: string}, id: {type: string}, retention_days: {type: integer}, size: {type: integer}, status: {type: string}}}, + }, fly.ContainerConfig: OpenApiSchema { + name=fly.ContainerConfig, + type=object, + properties={cmd: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/cmd, + component=OpenApiSchema { + name=cmd, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/cmd/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.ContainerConfig/properties/cmd/items, + node={type: string}, + }, + }, + description=CmdOverride is used to override the default command of the image., + ref=#/components/schemas/fly.ContainerConfig/properties/cmd, + node={type: array, description: CmdOverride is used to override the default command of the image., items: {type: string}}, + }, + }, depends_on: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/depends_on, + component=OpenApiSchema { + name=depends_on, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/depends_on/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ContainerDependency, + name=fly.ContainerDependency, + node={$ref: #/components/schemas/fly.ContainerDependency}, + }, + node={$ref: #/components/schemas/fly.ContainerDependency}, + }, + description=DependsOn can be used to define dependencies between containers. The container will only be +started after all of its dependent conditions have been satisfied., + ref=#/components/schemas/fly.ContainerConfig/properties/depends_on, + node={type: array, description: DependsOn can be used to define dependencies between containers. The container will only be +started after all of its dependent conditions have been satisfied., items: {$ref: #/components/schemas/fly.ContainerDependency}}, + }, + }, entrypoint: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/entrypoint, + component=OpenApiSchema { + name=entrypoint, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/entrypoint/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.ContainerConfig/properties/entrypoint/items, + node={type: string}, + }, + }, + description=EntrypointOverride is used to override the default entrypoint of the image., + ref=#/components/schemas/fly.ContainerConfig/properties/entrypoint, + node={type: array, description: EntrypointOverride is used to override the default entrypoint of the image., items: {type: string}}, + }, + }, env: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/env, + component=OpenApiSchema { + name=env, + type=object, + additionalProperties=OpenApiAdditionalProperties { + schema=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/env/additionalProperties, + component=OpenApiSchema { + name=additionalProperties, + type=string, + ref=#/components/schemas/fly.ContainerConfig/properties/env/additionalProperties, + node={type: string}, + }, + }, + }, + description=ExtraEnv is used to add additional environment variables to the container., + ref=#/components/schemas/fly.ContainerConfig/properties/env, + node={type: object, additionalProperties: {type: string}, description: ExtraEnv is used to add additional environment variables to the container.}, + }, + }, env_from: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/env_from, + component=OpenApiSchema { + name=env_from, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/env_from/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.EnvFrom, + name=fly.EnvFrom, + node={$ref: #/components/schemas/fly.EnvFrom}, + }, + node={$ref: #/components/schemas/fly.EnvFrom}, + }, + description=EnvFrom can be provided to set environment variables from machine fields., + ref=#/components/schemas/fly.ContainerConfig/properties/env_from, + node={type: array, description: EnvFrom can be provided to set environment variables from machine fields., items: {$ref: #/components/schemas/fly.EnvFrom}}, + }, + }, exec: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/exec, + component=OpenApiSchema { + name=exec, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/exec/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.ContainerConfig/properties/exec/items, + node={type: string}, + }, + }, + description=Image Config overrides - these fields are used to override the image configuration. +If not provided, the image configuration will be used. +ExecOverride is used to override the default command of the image., + ref=#/components/schemas/fly.ContainerConfig/properties/exec, + node={type: array, description: Image Config overrides - these fields are used to override the image configuration. +If not provided, the image configuration will be used. +ExecOverride is used to override the default command of the image., items: {type: string}}, + }, + }, files: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/files, + component=OpenApiSchema { + name=files, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/files/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.File, + name=fly.File, + node={$ref: #/components/schemas/fly.File}, + }, + node={$ref: #/components/schemas/fly.File}, + }, + description=Files are files that will be written to the container file system., + ref=#/components/schemas/fly.ContainerConfig/properties/files, + node={type: array, description: Files are files that will be written to the container file system., items: {$ref: #/components/schemas/fly.File}}, + }, + }, healthchecks: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/healthchecks, + component=OpenApiSchema { + name=healthchecks, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/healthchecks/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ContainerHealthcheck, + name=fly.ContainerHealthcheck, + node={$ref: #/components/schemas/fly.ContainerHealthcheck}, + }, + node={$ref: #/components/schemas/fly.ContainerHealthcheck}, + }, + description=Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command., + ref=#/components/schemas/fly.ContainerConfig/properties/healthchecks, + node={type: array, description: Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command., items: {$ref: #/components/schemas/fly.ContainerHealthcheck}}, + }, + }, image: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/image, + component=OpenApiSchema { + name=image, + type=string, + description=Image is the docker image to run., + ref=#/components/schemas/fly.ContainerConfig/properties/image, + node={type: string, description: Image is the docker image to run.}, + }, + }, mounts: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/mounts, + component=OpenApiSchema { + name=mounts, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/mounts/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ContainerMount, + name=fly.ContainerMount, + node={$ref: #/components/schemas/fly.ContainerMount}, + }, + node={$ref: #/components/schemas/fly.ContainerMount}, + }, + description=Set of mounts added to the container. These must reference a volume in the machine config via its name., + ref=#/components/schemas/fly.ContainerConfig/properties/mounts, + node={type: array, description: Set of mounts added to the container. These must reference a volume in the machine config via its name., items: {$ref: #/components/schemas/fly.ContainerMount}}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/name, + component=OpenApiSchema { + name=name, + type=string, + description=Name is used to identify the container in the machine., + ref=#/components/schemas/fly.ContainerConfig/properties/name, + node={type: string, description: Name is used to identify the container in the machine.}, + }, + }, restart: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/restart, + component=OpenApiSchema { + name=restart, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/restart/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineRestart, + name=fly.MachineRestart, + node={$ref: #/components/schemas/fly.MachineRestart}, + }, + node={$ref: #/components/schemas/fly.MachineRestart}, + }], + description=Restart is used to define the restart policy for the container. NOTE: spot-price is not +supported for containers., + ref=#/components/schemas/fly.ContainerConfig/properties/restart, + node={type: object, description: Restart is used to define the restart policy for the container. NOTE: spot-price is not +supported for containers., allOf: [{$ref: #/components/schemas/fly.MachineRestart}]}, + }, + }, secrets: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/secrets, + component=OpenApiSchema { + name=secrets, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/secrets/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineSecret, + name=fly.MachineSecret, + node={$ref: #/components/schemas/fly.MachineSecret}, + }, + node={$ref: #/components/schemas/fly.MachineSecret}, + }, + description=Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., + ref=#/components/schemas/fly.ContainerConfig/properties/secrets, + node={type: array, description: Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., items: {$ref: #/components/schemas/fly.MachineSecret}}, + }, + }, stop: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/stop, + component=OpenApiSchema { + name=stop, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/stop/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.StopConfig, + name=fly.StopConfig, + node={$ref: #/components/schemas/fly.StopConfig}, + }, + node={$ref: #/components/schemas/fly.StopConfig}, + }], + description=Stop is used to define the signal and timeout for stopping the container., + ref=#/components/schemas/fly.ContainerConfig/properties/stop, + node={type: object, description: Stop is used to define the signal and timeout for stopping the container., allOf: [{$ref: #/components/schemas/fly.StopConfig}]}, + }, + }, user: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerConfig/properties/user, + component=OpenApiSchema { + name=user, + type=string, + description=UserOverride is used to override the default user of the image., + ref=#/components/schemas/fly.ContainerConfig/properties/user, + node={type: string, description: UserOverride is used to override the default user of the image.}, + }, + }}, + ref=#/components/schemas/fly.ContainerConfig, + node={type: object, properties: {cmd: {type: array, description: CmdOverride is used to override the default command of the image., items: {type: string}}, depends_on: {type: array, description: DependsOn can be used to define dependencies between containers. The container will only be +started after all of its dependent conditions have been satisfied., items: {$ref: #/components/schemas/fly.ContainerDependency}}, entrypoint: {type: array, description: EntrypointOverride is used to override the default entrypoint of the image., items: {type: string}}, env: {type: object, additionalProperties: {type: string}, description: ExtraEnv is used to add additional environment variables to the container.}, env_from: {type: array, description: EnvFrom can be provided to set environment variables from machine fields., items: {$ref: #/components/schemas/fly.EnvFrom}}, exec: {type: array, description: Image Config overrides - these fields are used to override the image configuration. +If not provided, the image configuration will be used. +ExecOverride is used to override the default command of the image., items: {type: string}}, files: {type: array, description: Files are files that will be written to the container file system., items: {$ref: #/components/schemas/fly.File}}, healthchecks: {type: array, description: Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command., items: {$ref: #/components/schemas/fly.ContainerHealthcheck}}, image: {type: string, description: Image is the docker image to run.}, mounts: {type: array, description: Set of mounts added to the container. These must reference a volume in the machine config via its name., items: {$ref: #/components/schemas/fly.ContainerMount}}, name: {type: string, description: Name is used to identify the container in the machine.}, restart: {type: object, description: Restart is used to define the restart policy for the container. NOTE: spot-price is not +supported for containers., allOf: [{$ref: #/components/schemas/fly.MachineRestart}]}, secrets: {type: array, description: Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., items: {$ref: #/components/schemas/fly.MachineSecret}}, stop: {type: object, description: Stop is used to define the signal and timeout for stopping the container., allOf: [{$ref: #/components/schemas/fly.StopConfig}]}, user: {type: string, description: UserOverride is used to override the default user of the image.}}}, + }, fly.ContainerDependency: OpenApiSchema { + name=fly.ContainerDependency, + type=object, + properties={condition: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerDependency/properties/condition, + component=OpenApiSchema { + name=condition, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerDependency/properties/condition/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ContainerDependencyCondition, + name=fly.ContainerDependencyCondition, + node={$ref: #/components/schemas/fly.ContainerDependencyCondition}, + }, + node={$ref: #/components/schemas/fly.ContainerDependencyCondition}, + }], + ref=#/components/schemas/fly.ContainerDependency/properties/condition, + node={type: object, allOf: [{$ref: #/components/schemas/fly.ContainerDependencyCondition}]}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerDependency/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/fly.ContainerDependency/properties/name, + node={type: string}, + }, + }}, + ref=#/components/schemas/fly.ContainerDependency, + node={type: object, properties: {condition: {type: object, allOf: [{$ref: #/components/schemas/fly.ContainerDependencyCondition}]}, name: {type: string}}}, + }, fly.ContainerDependencyCondition: OpenApiSchema { + name=fly.ContainerDependencyCondition, + type=string, + enumValues={exited_successfully, healthy, started}, + ref=#/components/schemas/fly.ContainerDependencyCondition, + node={type: string, enum: [exited_successfully, healthy, started], x-enum-varnames: [ExitedSuccessfully, Healthy, Started]}, + extensions={x-enum-varnames: [ExitedSuccessfully, Healthy, Started]}, + }, fly.ContainerHealthcheck: OpenApiSchema { + name=fly.ContainerHealthcheck, + type=object, + properties={exec: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/exec, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ExecHealthcheck, + name=fly.ExecHealthcheck, + node={$ref: #/components/schemas/fly.ExecHealthcheck}, + }, + node={$ref: #/components/schemas/fly.ExecHealthcheck}, + }, failure_threshold: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/failure_threshold, + component=OpenApiSchema { + name=failure_threshold, + type=integer, + description=The number of times the check must fail before considering the container unhealthy., + ref=#/components/schemas/fly.ContainerHealthcheck/properties/failure_threshold, + node={type: integer, description: The number of times the check must fail before considering the container unhealthy.}, + }, + }, grace_period: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/grace_period, + component=OpenApiSchema { + name=grace_period, + type=integer, + description=The time in seconds to wait after a container starts before checking its health., + ref=#/components/schemas/fly.ContainerHealthcheck/properties/grace_period, + node={type: integer, description: The time in seconds to wait after a container starts before checking its health.}, + }, + }, http: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/http, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.HTTPHealthcheck, + name=fly.HTTPHealthcheck, + node={$ref: #/components/schemas/fly.HTTPHealthcheck}, + }, + node={$ref: #/components/schemas/fly.HTTPHealthcheck}, + }, interval: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/interval, + component=OpenApiSchema { + name=interval, + type=integer, + description=The time in seconds between executing the defined check., + ref=#/components/schemas/fly.ContainerHealthcheck/properties/interval, + node={type: integer, description: The time in seconds between executing the defined check.}, + }, + }, kind: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/kind, + component=OpenApiSchema { + name=kind, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/kind/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ContainerHealthcheckKind, + name=fly.ContainerHealthcheckKind, + node={$ref: #/components/schemas/fly.ContainerHealthcheckKind}, + }, + node={$ref: #/components/schemas/fly.ContainerHealthcheckKind}, + }], + description=Kind of healthcheck (readiness, liveness), + ref=#/components/schemas/fly.ContainerHealthcheck/properties/kind, + node={type: object, description: Kind of healthcheck (readiness, liveness), allOf: [{$ref: #/components/schemas/fly.ContainerHealthcheckKind}]}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/name, + component=OpenApiSchema { + name=name, + type=string, + description=The name of the check. Must be unique within the container., + ref=#/components/schemas/fly.ContainerHealthcheck/properties/name, + node={type: string, description: The name of the check. Must be unique within the container.}, + }, + }, success_threshold: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/success_threshold, + component=OpenApiSchema { + name=success_threshold, + type=integer, + description=The number of times the check must succeeed before considering the container healthy., + ref=#/components/schemas/fly.ContainerHealthcheck/properties/success_threshold, + node={type: integer, description: The number of times the check must succeeed before considering the container healthy.}, + }, + }, tcp: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/tcp, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.TCPHealthcheck, + name=fly.TCPHealthcheck, + node={$ref: #/components/schemas/fly.TCPHealthcheck}, + }, + node={$ref: #/components/schemas/fly.TCPHealthcheck}, + }, timeout: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/timeout, + component=OpenApiSchema { + name=timeout, + type=integer, + description=The time in seconds to wait for the check to complete., + ref=#/components/schemas/fly.ContainerHealthcheck/properties/timeout, + node={type: integer, description: The time in seconds to wait for the check to complete.}, + }, + }, unhealthy: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/unhealthy, + component=OpenApiSchema { + name=unhealthy, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerHealthcheck/properties/unhealthy/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.UnhealthyPolicy, + name=fly.UnhealthyPolicy, + node={$ref: #/components/schemas/fly.UnhealthyPolicy}, + }, + node={$ref: #/components/schemas/fly.UnhealthyPolicy}, + }], + description=Unhealthy policy that determines what action to take if a container is deemed unhealthy, + ref=#/components/schemas/fly.ContainerHealthcheck/properties/unhealthy, + node={type: object, description: Unhealthy policy that determines what action to take if a container is deemed unhealthy, allOf: [{$ref: #/components/schemas/fly.UnhealthyPolicy}]}, + }, + }}, + ref=#/components/schemas/fly.ContainerHealthcheck, + node={type: object, properties: {exec: {$ref: #/components/schemas/fly.ExecHealthcheck}, failure_threshold: {type: integer, description: The number of times the check must fail before considering the container unhealthy.}, grace_period: {type: integer, description: The time in seconds to wait after a container starts before checking its health.}, http: {$ref: #/components/schemas/fly.HTTPHealthcheck}, interval: {type: integer, description: The time in seconds between executing the defined check.}, kind: {type: object, description: Kind of healthcheck (readiness, liveness), allOf: [{$ref: #/components/schemas/fly.ContainerHealthcheckKind}]}, name: {type: string, description: The name of the check. Must be unique within the container.}, success_threshold: {type: integer, description: The number of times the check must succeeed before considering the container healthy.}, tcp: {$ref: #/components/schemas/fly.TCPHealthcheck}, timeout: {type: integer, description: The time in seconds to wait for the check to complete.}, unhealthy: {type: object, description: Unhealthy policy that determines what action to take if a container is deemed unhealthy, allOf: [{$ref: #/components/schemas/fly.UnhealthyPolicy}]}}}, + }, fly.ContainerHealthcheckKind: OpenApiSchema { + name=fly.ContainerHealthcheckKind, + type=string, + enumValues={readiness, liveness}, + ref=#/components/schemas/fly.ContainerHealthcheckKind, + node={type: string, enum: [readiness, liveness], x-enum-varnames: [Readiness, Liveness]}, + extensions={x-enum-varnames: [Readiness, Liveness]}, + }, fly.ContainerHealthcheckScheme: OpenApiSchema { + name=fly.ContainerHealthcheckScheme, + type=string, + enumValues={http, https}, + ref=#/components/schemas/fly.ContainerHealthcheckScheme, + node={type: string, enum: [http, https], x-enum-varnames: [HTTP, HTTPS]}, + extensions={x-enum-varnames: [HTTP, HTTPS]}, + }, fly.ContainerMount: OpenApiSchema { + name=fly.ContainerMount, + type=object, + properties={name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerMount/properties/name, + component=OpenApiSchema { + name=name, + type=string, + description=The name of the volume. Must exist in the volumes field in the machine configuration, + ref=#/components/schemas/fly.ContainerMount/properties/name, + node={type: string, description: The name of the volume. Must exist in the volumes field in the machine configuration}, + }, + }, path: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ContainerMount/properties/path, + component=OpenApiSchema { + name=path, + type=string, + description=The path to mount the volume within the container, + ref=#/components/schemas/fly.ContainerMount/properties/path, + node={type: string, description: The path to mount the volume within the container}, + }, + }}, + ref=#/components/schemas/fly.ContainerMount, + node={type: object, properties: {name: {type: string, description: The name of the volume. Must exist in the volumes field in the machine configuration}, path: {type: string, description: The path to mount the volume within the container}}}, + }, fly.DNSConfig: OpenApiSchema { + name=fly.DNSConfig, + type=object, + properties={dns_forward_rules: OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/dns_forward_rules, + component=OpenApiSchema { + name=dns_forward_rules, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/dns_forward_rules/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.dnsForwardRule, + name=fly.dnsForwardRule, + node={$ref: #/components/schemas/fly.dnsForwardRule}, + }, + node={$ref: #/components/schemas/fly.dnsForwardRule}, + }, + ref=#/components/schemas/fly.DNSConfig/properties/dns_forward_rules, + node={type: array, items: {$ref: #/components/schemas/fly.dnsForwardRule}}, + }, + }, hostname: OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/hostname, + component=OpenApiSchema { + name=hostname, + type=string, + ref=#/components/schemas/fly.DNSConfig/properties/hostname, + node={type: string}, + }, + }, hostname_fqdn: OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/hostname_fqdn, + component=OpenApiSchema { + name=hostname_fqdn, + type=string, + ref=#/components/schemas/fly.DNSConfig/properties/hostname_fqdn, + node={type: string}, + }, + }, nameservers: OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/nameservers, + component=OpenApiSchema { + name=nameservers, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/nameservers/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.DNSConfig/properties/nameservers/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.DNSConfig/properties/nameservers, + node={type: array, items: {type: string}}, + }, + }, options: OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/options, + component=OpenApiSchema { + name=options, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/options/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.dnsOption, + name=fly.dnsOption, + node={$ref: #/components/schemas/fly.dnsOption}, + }, + node={$ref: #/components/schemas/fly.dnsOption}, + }, + ref=#/components/schemas/fly.DNSConfig/properties/options, + node={type: array, items: {$ref: #/components/schemas/fly.dnsOption}}, + }, + }, searches: OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/searches, + component=OpenApiSchema { + name=searches, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/searches/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.DNSConfig/properties/searches/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.DNSConfig/properties/searches, + node={type: array, items: {type: string}}, + }, + }, skip_registration: OpenApiComponentOrRef { + ref=#/components/schemas/fly.DNSConfig/properties/skip_registration, + component=OpenApiSchema { + name=skip_registration, + type=boolean, + ref=#/components/schemas/fly.DNSConfig/properties/skip_registration, + node={type: boolean}, + }, + }}, + ref=#/components/schemas/fly.DNSConfig, + node={type: object, properties: {dns_forward_rules: {type: array, items: {$ref: #/components/schemas/fly.dnsForwardRule}}, hostname: {type: string}, hostname_fqdn: {type: string}, nameservers: {type: array, items: {type: string}}, options: {type: array, items: {$ref: #/components/schemas/fly.dnsOption}}, searches: {type: array, items: {type: string}}, skip_registration: {type: boolean}}}, + }, fly.Duration: OpenApiSchema { + name=fly.Duration, + type=object, + properties={time.Duration: OpenApiComponentOrRef { + ref=#/components/schemas/fly.Duration/properties/time.Duration, + component=OpenApiSchema { + name=time.Duration, + type=integer, + ref=#/components/schemas/fly.Duration/properties/time.Duration, + node={type: integer, x-enum-varnames: [minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour]}, + extensions={x-enum-varnames: [minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour]}, + }, + }}, + ref=#/components/schemas/fly.Duration, + node={type: object, properties: {time.Duration: {type: integer, x-enum-varnames: [minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour]}}}, + }, fly.EnvFrom: OpenApiSchema { + name=fly.EnvFrom, + type=object, + properties={env_var: OpenApiComponentOrRef { + ref=#/components/schemas/fly.EnvFrom/properties/env_var, + component=OpenApiSchema { + name=env_var, + type=string, + description=EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name., + ref=#/components/schemas/fly.EnvFrom/properties/env_var, + node={type: string, description: EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name.}, + }, + }, field_ref: OpenApiComponentOrRef { + ref=#/components/schemas/fly.EnvFrom/properties/field_ref, + component=OpenApiSchema { + name=field_ref, + type=string, + enumValues={id, version, app_name, private_ip, region, image}, + description=FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image., + ref=#/components/schemas/fly.EnvFrom/properties/field_ref, + node={type: string, description: FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image., enum: [id, version, app_name, private_ip, region, image]}, + }, + }}, + description=EnvVar defines an environment variable to be populated from a machine field, env_var, + ref=#/components/schemas/fly.EnvFrom, + node={type: object, properties: {env_var: {type: string, description: EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name.}, field_ref: {type: string, description: FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image., enum: [id, version, app_name, private_ip, region, image]}}, description: EnvVar defines an environment variable to be populated from a machine field, env_var}, + }, fly.ExecHealthcheck: OpenApiSchema { + name=fly.ExecHealthcheck, + type=object, + properties={command: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ExecHealthcheck/properties/command, + component=OpenApiSchema { + name=command, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.ExecHealthcheck/properties/command/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.ExecHealthcheck/properties/command/items, + node={type: string}, + }, + }, + description=The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"]), + ref=#/components/schemas/fly.ExecHealthcheck/properties/command, + node={type: array, description: The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"]), items: {type: string}}, + }, + }}, + ref=#/components/schemas/fly.ExecHealthcheck, + node={type: object, properties: {command: {type: array, description: The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"]), items: {type: string}}}}, + }, fly.File: OpenApiSchema { + name=fly.File, + type=object, + properties={guest_path: OpenApiComponentOrRef { + ref=#/components/schemas/fly.File/properties/guest_path, + component=OpenApiSchema { + name=guest_path, + type=string, + description=GuestPath is the path on the machine where the file will be written and must be an absolute path. +For example: /full/path/to/file.json, + ref=#/components/schemas/fly.File/properties/guest_path, + node={type: string, description: GuestPath is the path on the machine where the file will be written and must be an absolute path. +For example: /full/path/to/file.json}, + }, + }, mode: OpenApiComponentOrRef { + ref=#/components/schemas/fly.File/properties/mode, + component=OpenApiSchema { + name=mode, + type=integer, + description=Mode bits used to set permissions on this file as accepted by chmod(2)., + ref=#/components/schemas/fly.File/properties/mode, + node={type: integer, description: Mode bits used to set permissions on this file as accepted by chmod(2).}, + }, + }, raw_value: OpenApiComponentOrRef { + ref=#/components/schemas/fly.File/properties/raw_value, + component=OpenApiSchema { + name=raw_value, + type=string, + description=The base64 encoded string of the file contents., + ref=#/components/schemas/fly.File/properties/raw_value, + node={type: string, description: The base64 encoded string of the file contents.}, + }, + }, secret_name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.File/properties/secret_name, + component=OpenApiSchema { + name=secret_name, + type=string, + description=The name of the secret that contains the base64 encoded file contents., + ref=#/components/schemas/fly.File/properties/secret_name, + node={type: string, description: The name of the secret that contains the base64 encoded file contents.}, + }, + }}, + description=A file that will be written to the Machine. One of RawValue or SecretName must be set., + ref=#/components/schemas/fly.File, + node={type: object, properties: {guest_path: {type: string, description: GuestPath is the path on the machine where the file will be written and must be an absolute path. +For example: /full/path/to/file.json}, mode: {type: integer, description: Mode bits used to set permissions on this file as accepted by chmod(2).}, raw_value: {type: string, description: The base64 encoded string of the file contents.}, secret_name: {type: string, description: The name of the secret that contains the base64 encoded file contents.}}, description: A file that will be written to the Machine. One of RawValue or SecretName must be set.}, + }, fly.HTTPHealthcheck: OpenApiSchema { + name=fly.HTTPHealthcheck, + type=object, + properties={headers: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/headers, + component=OpenApiSchema { + name=headers, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/headers/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineHTTPHeader, + name=fly.MachineHTTPHeader, + node={$ref: #/components/schemas/fly.MachineHTTPHeader}, + }, + node={$ref: #/components/schemas/fly.MachineHTTPHeader}, + }, + description=Additional headers to send with the request, + ref=#/components/schemas/fly.HTTPHealthcheck/properties/headers, + node={type: array, description: Additional headers to send with the request, items: {$ref: #/components/schemas/fly.MachineHTTPHeader}}, + }, + }, method: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/method, + component=OpenApiSchema { + name=method, + type=string, + description=The HTTP method to use to when making the request, + ref=#/components/schemas/fly.HTTPHealthcheck/properties/method, + node={type: string, description: The HTTP method to use to when making the request}, + }, + }, path: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/path, + component=OpenApiSchema { + name=path, + type=string, + description=The path to send the request to, + ref=#/components/schemas/fly.HTTPHealthcheck/properties/path, + node={type: string, description: The path to send the request to}, + }, + }, port: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/port, + component=OpenApiSchema { + name=port, + type=integer, + description=The port to connect to, often the same as internal_port, + ref=#/components/schemas/fly.HTTPHealthcheck/properties/port, + node={type: integer, description: The port to connect to, often the same as internal_port}, + }, + }, scheme: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/scheme, + component=OpenApiSchema { + name=scheme, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/scheme/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ContainerHealthcheckScheme, + name=fly.ContainerHealthcheckScheme, + node={$ref: #/components/schemas/fly.ContainerHealthcheckScheme}, + }, + node={$ref: #/components/schemas/fly.ContainerHealthcheckScheme}, + }], + description=Whether to use http or https, + ref=#/components/schemas/fly.HTTPHealthcheck/properties/scheme, + node={type: object, description: Whether to use http or https, allOf: [{$ref: #/components/schemas/fly.ContainerHealthcheckScheme}]}, + }, + }, tls_server_name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/tls_server_name, + component=OpenApiSchema { + name=tls_server_name, + type=string, + description=If the protocol is https, the hostname to use for TLS certificate validation, + ref=#/components/schemas/fly.HTTPHealthcheck/properties/tls_server_name, + node={type: string, description: If the protocol is https, the hostname to use for TLS certificate validation}, + }, + }, tls_skip_verify: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPHealthcheck/properties/tls_skip_verify, + component=OpenApiSchema { + name=tls_skip_verify, + type=boolean, + description=If the protocol is https, whether or not to verify the TLS certificate, + ref=#/components/schemas/fly.HTTPHealthcheck/properties/tls_skip_verify, + node={type: boolean, description: If the protocol is https, whether or not to verify the TLS certificate}, + }, + }}, + ref=#/components/schemas/fly.HTTPHealthcheck, + node={type: object, properties: {headers: {type: array, description: Additional headers to send with the request, items: {$ref: #/components/schemas/fly.MachineHTTPHeader}}, method: {type: string, description: The HTTP method to use to when making the request}, path: {type: string, description: The path to send the request to}, port: {type: integer, description: The port to connect to, often the same as internal_port}, scheme: {type: object, description: Whether to use http or https, allOf: [{$ref: #/components/schemas/fly.ContainerHealthcheckScheme}]}, tls_server_name: {type: string, description: If the protocol is https, the hostname to use for TLS certificate validation}, tls_skip_verify: {type: boolean, description: If the protocol is https, whether or not to verify the TLS certificate}}}, + }, fly.HTTPOptions: OpenApiSchema { + name=fly.HTTPOptions, + type=object, + properties={compress: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPOptions/properties/compress, + component=OpenApiSchema { + name=compress, + type=boolean, + ref=#/components/schemas/fly.HTTPOptions/properties/compress, + node={type: boolean}, + }, + }, h2_backend: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPOptions/properties/h2_backend, + component=OpenApiSchema { + name=h2_backend, + type=boolean, + ref=#/components/schemas/fly.HTTPOptions/properties/h2_backend, + node={type: boolean}, + }, + }, headers_read_timeout: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPOptions/properties/headers_read_timeout, + component=OpenApiSchema { + name=headers_read_timeout, + type=integer, + ref=#/components/schemas/fly.HTTPOptions/properties/headers_read_timeout, + node={type: integer}, + }, + }, idle_timeout: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPOptions/properties/idle_timeout, + component=OpenApiSchema { + name=idle_timeout, + type=integer, + ref=#/components/schemas/fly.HTTPOptions/properties/idle_timeout, + node={type: integer}, + }, + }, response: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPOptions/properties/response, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.HTTPResponseOptions, + name=fly.HTTPResponseOptions, + node={$ref: #/components/schemas/fly.HTTPResponseOptions}, + }, + node={$ref: #/components/schemas/fly.HTTPResponseOptions}, + }}, + ref=#/components/schemas/fly.HTTPOptions, + node={type: object, properties: {compress: {type: boolean}, h2_backend: {type: boolean}, headers_read_timeout: {type: integer}, idle_timeout: {type: integer}, response: {$ref: #/components/schemas/fly.HTTPResponseOptions}}}, + }, fly.HTTPResponseOptions: OpenApiSchema { + name=fly.HTTPResponseOptions, + type=object, + properties={headers: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPResponseOptions/properties/headers, + component=OpenApiSchema { + name=headers, + type=object, + additionalProperties=OpenApiAdditionalProperties { + schema=OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPResponseOptions/properties/headers/additionalProperties, + component=OpenApiSchema { + name=additionalProperties, + type=object, + ref=#/components/schemas/fly.HTTPResponseOptions/properties/headers/additionalProperties, + node={type: object}, + }, + }, + }, + ref=#/components/schemas/fly.HTTPResponseOptions/properties/headers, + node={type: object, additionalProperties: {type: object}}, + }, + }, pristine: OpenApiComponentOrRef { + ref=#/components/schemas/fly.HTTPResponseOptions/properties/pristine, + component=OpenApiSchema { + name=pristine, + type=boolean, + ref=#/components/schemas/fly.HTTPResponseOptions/properties/pristine, + node={type: boolean}, + }, + }}, + ref=#/components/schemas/fly.HTTPResponseOptions, + node={type: object, properties: {headers: {type: object, additionalProperties: {type: object}}, pristine: {type: boolean}}}, + }, fly.MachineCheck: OpenApiSchema { + name=fly.MachineCheck, + type=object, + properties={grace_period: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/grace_period, + component=OpenApiSchema { + name=grace_period, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/grace_period/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.Duration, + name=fly.Duration, + node={$ref: #/components/schemas/fly.Duration}, + }, + node={$ref: #/components/schemas/fly.Duration}, + }], + description=The time to wait after a VM starts before checking its health, + ref=#/components/schemas/fly.MachineCheck/properties/grace_period, + node={type: object, description: The time to wait after a VM starts before checking its health, allOf: [{$ref: #/components/schemas/fly.Duration}]}, + }, + }, headers: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/headers, + component=OpenApiSchema { + name=headers, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/headers/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineHTTPHeader, + name=fly.MachineHTTPHeader, + node={$ref: #/components/schemas/fly.MachineHTTPHeader}, + }, + node={$ref: #/components/schemas/fly.MachineHTTPHeader}, + }, + ref=#/components/schemas/fly.MachineCheck/properties/headers, + node={type: array, items: {$ref: #/components/schemas/fly.MachineHTTPHeader}}, + }, + }, interval: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/interval, + component=OpenApiSchema { + name=interval, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/interval/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.Duration, + name=fly.Duration, + node={$ref: #/components/schemas/fly.Duration}, + }, + node={$ref: #/components/schemas/fly.Duration}, + }], + description=The time between connectivity checks, + ref=#/components/schemas/fly.MachineCheck/properties/interval, + node={type: object, description: The time between connectivity checks, allOf: [{$ref: #/components/schemas/fly.Duration}]}, + }, + }, kind: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/kind, + component=OpenApiSchema { + name=kind, + type=string, + enumValues={informational, readiness}, + description=Kind of the check (informational, readiness), + ref=#/components/schemas/fly.MachineCheck/properties/kind, + node={type: string, description: Kind of the check (informational, readiness), enum: [informational, readiness]}, + }, + }, method: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/method, + component=OpenApiSchema { + name=method, + type=string, + description=For http checks, the HTTP method to use to when making the request, + ref=#/components/schemas/fly.MachineCheck/properties/method, + node={type: string, description: For http checks, the HTTP method to use to when making the request}, + }, + }, path: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/path, + component=OpenApiSchema { + name=path, + type=string, + description=For http checks, the path to send the request to, + ref=#/components/schemas/fly.MachineCheck/properties/path, + node={type: string, description: For http checks, the path to send the request to}, + }, + }, port: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/port, + component=OpenApiSchema { + name=port, + type=integer, + description=The port to connect to, often the same as internal_port, + ref=#/components/schemas/fly.MachineCheck/properties/port, + node={type: integer, description: The port to connect to, often the same as internal_port}, + }, + }, protocol: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/protocol, + component=OpenApiSchema { + name=protocol, + type=string, + description=For http checks, whether to use http or https, + ref=#/components/schemas/fly.MachineCheck/properties/protocol, + node={type: string, description: For http checks, whether to use http or https}, + }, + }, timeout: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/timeout, + component=OpenApiSchema { + name=timeout, + type=object, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/timeout/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.Duration, + name=fly.Duration, + node={$ref: #/components/schemas/fly.Duration}, + }, + node={$ref: #/components/schemas/fly.Duration}, + }], + description=The maximum time a connection can take before being reported as failing its health check, + ref=#/components/schemas/fly.MachineCheck/properties/timeout, + node={type: object, description: The maximum time a connection can take before being reported as failing its health check, allOf: [{$ref: #/components/schemas/fly.Duration}]}, + }, + }, tls_server_name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/tls_server_name, + component=OpenApiSchema { + name=tls_server_name, + type=string, + description=If the protocol is https, the hostname to use for TLS certificate validation, + ref=#/components/schemas/fly.MachineCheck/properties/tls_server_name, + node={type: string, description: If the protocol is https, the hostname to use for TLS certificate validation}, + }, + }, tls_skip_verify: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/tls_skip_verify, + component=OpenApiSchema { + name=tls_skip_verify, + type=boolean, + description=For http checks with https protocol, whether or not to verify the TLS certificate, + ref=#/components/schemas/fly.MachineCheck/properties/tls_skip_verify, + node={type: boolean, description: For http checks with https protocol, whether or not to verify the TLS certificate}, + }, + }, type: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineCheck/properties/type, + component=OpenApiSchema { + name=type, + type=string, + description=tcp or http, + ref=#/components/schemas/fly.MachineCheck/properties/type, + node={type: string, description: tcp or http}, + }, + }}, + description=An optional object that defines one or more named checks. The key for each check is the check name., + ref=#/components/schemas/fly.MachineCheck, + node={type: object, properties: {grace_period: {type: object, description: The time to wait after a VM starts before checking its health, allOf: [{$ref: #/components/schemas/fly.Duration}]}, headers: {type: array, items: {$ref: #/components/schemas/fly.MachineHTTPHeader}}, interval: {type: object, description: The time between connectivity checks, allOf: [{$ref: #/components/schemas/fly.Duration}]}, kind: {type: string, description: Kind of the check (informational, readiness), enum: [informational, readiness]}, method: {type: string, description: For http checks, the HTTP method to use to when making the request}, path: {type: string, description: For http checks, the path to send the request to}, port: {type: integer, description: The port to connect to, often the same as internal_port}, protocol: {type: string, description: For http checks, whether to use http or https}, timeout: {type: object, description: The maximum time a connection can take before being reported as failing its health check, allOf: [{$ref: #/components/schemas/fly.Duration}]}, tls_server_name: {type: string, description: If the protocol is https, the hostname to use for TLS certificate validation}, tls_skip_verify: {type: boolean, description: For http checks with https protocol, whether or not to verify the TLS certificate}, type: {type: string, description: tcp or http}}, description: An optional object that defines one or more named checks. The key for each check is the check name.}, + }, fly.MachineConfig: OpenApiSchema { + name=fly.MachineConfig, + type=object, + properties={auto_destroy: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/auto_destroy, + component=OpenApiSchema { + name=auto_destroy, + type=boolean, + description=Optional boolean telling the Machine to destroy itself once it’s complete (default false), + ref=#/components/schemas/fly.MachineConfig/properties/auto_destroy, + node={type: boolean, description: Optional boolean telling the Machine to destroy itself once it’s complete (default false)}, + }, + }, checks: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/checks, + component=OpenApiSchema { + name=checks, + type=object, + additionalProperties=OpenApiAdditionalProperties { + schema=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/checks/additionalProperties, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineCheck, + name=fly.MachineCheck, + node={$ref: #/components/schemas/fly.MachineCheck}, + }, + node={$ref: #/components/schemas/fly.MachineCheck}, + }, + }, + ref=#/components/schemas/fly.MachineConfig/properties/checks, + node={type: object, additionalProperties: {$ref: #/components/schemas/fly.MachineCheck}}, + }, + }, containers: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/containers, + component=OpenApiSchema { + name=containers, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/containers/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ContainerConfig, + name=fly.ContainerConfig, + node={$ref: #/components/schemas/fly.ContainerConfig}, + }, + node={$ref: #/components/schemas/fly.ContainerConfig}, + }, + description=Containers are a list of containers that will run in the machine. Currently restricted to +only specific organizations., + ref=#/components/schemas/fly.MachineConfig/properties/containers, + node={type: array, description: Containers are a list of containers that will run in the machine. Currently restricted to +only specific organizations., items: {$ref: #/components/schemas/fly.ContainerConfig}}, + }, + }, disable_machine_autostart: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/disable_machine_autostart, + component=OpenApiSchema { + name=disable_machine_autostart, + type=boolean, + description=Deprecated: use Service.Autostart instead, + ref=#/components/schemas/fly.MachineConfig/properties/disable_machine_autostart, + node={type: boolean, description: Deprecated: use Service.Autostart instead}, + }, + }, dns: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/dns, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.DNSConfig, + name=fly.DNSConfig, + node={$ref: #/components/schemas/fly.DNSConfig}, + }, + node={$ref: #/components/schemas/fly.DNSConfig}, + }, env: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/env, + component=OpenApiSchema { + name=env, + type=object, + additionalProperties=OpenApiAdditionalProperties { + schema=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/env/additionalProperties, + component=OpenApiSchema { + name=additionalProperties, + type=string, + ref=#/components/schemas/fly.MachineConfig/properties/env/additionalProperties, + node={type: string}, + }, + }, + }, + description=An object filled with key/value pairs to be set as environment variables, + ref=#/components/schemas/fly.MachineConfig/properties/env, + node={type: object, additionalProperties: {type: string}, description: An object filled with key/value pairs to be set as environment variables}, + }, + }, files: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/files, + component=OpenApiSchema { + name=files, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/files/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.File, + name=fly.File, + node={$ref: #/components/schemas/fly.File}, + }, + node={$ref: #/components/schemas/fly.File}, + }, + ref=#/components/schemas/fly.MachineConfig/properties/files, + node={type: array, items: {$ref: #/components/schemas/fly.File}}, + }, + }, guest: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/guest, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineGuest, + name=fly.MachineGuest, + node={$ref: #/components/schemas/fly.MachineGuest}, + }, + node={$ref: #/components/schemas/fly.MachineGuest}, + }, image: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/image, + component=OpenApiSchema { + name=image, + type=string, + description=The docker image to run, + ref=#/components/schemas/fly.MachineConfig/properties/image, + node={type: string, description: The docker image to run}, + }, + }, init: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/init, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineInit, + name=fly.MachineInit, + node={$ref: #/components/schemas/fly.MachineInit}, + }, + node={$ref: #/components/schemas/fly.MachineInit}, + }, metadata: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/metadata, + component=OpenApiSchema { + name=metadata, + type=object, + additionalProperties=OpenApiAdditionalProperties { + schema=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/metadata/additionalProperties, + component=OpenApiSchema { + name=additionalProperties, + type=string, + ref=#/components/schemas/fly.MachineConfig/properties/metadata/additionalProperties, + node={type: string}, + }, + }, + }, + ref=#/components/schemas/fly.MachineConfig/properties/metadata, + node={type: object, additionalProperties: {type: string}}, + }, + }, metrics: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/metrics, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineMetrics, + name=fly.MachineMetrics, + node={$ref: #/components/schemas/fly.MachineMetrics}, + }, + node={$ref: #/components/schemas/fly.MachineMetrics}, + }, mounts: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/mounts, + component=OpenApiSchema { + name=mounts, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/mounts/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineMount, + name=fly.MachineMount, + node={$ref: #/components/schemas/fly.MachineMount}, + }, + node={$ref: #/components/schemas/fly.MachineMount}, + }, + ref=#/components/schemas/fly.MachineConfig/properties/mounts, + node={type: array, items: {$ref: #/components/schemas/fly.MachineMount}}, + }, + }, processes: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/processes, + component=OpenApiSchema { + name=processes, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/processes/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineProcess, + name=fly.MachineProcess, + node={$ref: #/components/schemas/fly.MachineProcess}, + }, + node={$ref: #/components/schemas/fly.MachineProcess}, + }, + ref=#/components/schemas/fly.MachineConfig/properties/processes, + node={type: array, items: {$ref: #/components/schemas/fly.MachineProcess}}, + }, + }, restart: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/restart, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineRestart, + name=fly.MachineRestart, + node={$ref: #/components/schemas/fly.MachineRestart}, + }, + node={$ref: #/components/schemas/fly.MachineRestart}, + }, schedule: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/schedule, + component=OpenApiSchema { + name=schedule, + type=string, + ref=#/components/schemas/fly.MachineConfig/properties/schedule, + node={type: string}, + }, + }, services: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/services, + component=OpenApiSchema { + name=services, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/services/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineService, + name=fly.MachineService, + node={$ref: #/components/schemas/fly.MachineService}, + }, + node={$ref: #/components/schemas/fly.MachineService}, + }, + ref=#/components/schemas/fly.MachineConfig/properties/services, + node={type: array, items: {$ref: #/components/schemas/fly.MachineService}}, + }, + }, size: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/size, + component=OpenApiSchema { + name=size, + type=string, + description=Deprecated: use Guest instead, + ref=#/components/schemas/fly.MachineConfig/properties/size, + node={type: string, description: Deprecated: use Guest instead}, + }, + }, standbys: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/standbys, + component=OpenApiSchema { + name=standbys, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/standbys/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineConfig/properties/standbys/items, + node={type: string}, + }, + }, + description=Standbys enable a machine to be a standby for another. In the event of a hardware failure, +the standby machine will be started., + ref=#/components/schemas/fly.MachineConfig/properties/standbys, + node={type: array, description: Standbys enable a machine to be a standby for another. In the event of a hardware failure, +the standby machine will be started., items: {type: string}}, + }, + }, statics: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/statics, + component=OpenApiSchema { + name=statics, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/statics/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.Static, + name=fly.Static, + node={$ref: #/components/schemas/fly.Static}, + }, + node={$ref: #/components/schemas/fly.Static}, + }, + ref=#/components/schemas/fly.MachineConfig/properties/statics, + node={type: array, items: {$ref: #/components/schemas/fly.Static}}, + }, + }, stop_config: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/stop_config, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.StopConfig, + name=fly.StopConfig, + node={$ref: #/components/schemas/fly.StopConfig}, + }, + node={$ref: #/components/schemas/fly.StopConfig}, + }, volumes: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/volumes, + component=OpenApiSchema { + name=volumes, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineConfig/properties/volumes/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.VolumeConfig, + name=fly.VolumeConfig, + node={$ref: #/components/schemas/fly.VolumeConfig}, + }, + node={$ref: #/components/schemas/fly.VolumeConfig}, + }, + description=Volumes describe the set of volumes that can be attached to the machine. Used in conjuction +with containers, + ref=#/components/schemas/fly.MachineConfig/properties/volumes, + node={type: array, description: Volumes describe the set of volumes that can be attached to the machine. Used in conjuction +with containers, items: {$ref: #/components/schemas/fly.VolumeConfig}}, + }, + }}, + ref=#/components/schemas/fly.MachineConfig, + node={type: object, properties: {auto_destroy: {type: boolean, description: Optional boolean telling the Machine to destroy itself once it’s complete (default false)}, checks: {type: object, additionalProperties: {$ref: #/components/schemas/fly.MachineCheck}}, containers: {type: array, description: Containers are a list of containers that will run in the machine. Currently restricted to +only specific organizations., items: {$ref: #/components/schemas/fly.ContainerConfig}}, disable_machine_autostart: {type: boolean, description: Deprecated: use Service.Autostart instead}, dns: {$ref: #/components/schemas/fly.DNSConfig}, env: {type: object, additionalProperties: {type: string}, description: An object filled with key/value pairs to be set as environment variables}, files: {type: array, items: {$ref: #/components/schemas/fly.File}}, guest: {$ref: #/components/schemas/fly.MachineGuest}, image: {type: string, description: The docker image to run}, init: {$ref: #/components/schemas/fly.MachineInit}, metadata: {type: object, additionalProperties: {type: string}}, metrics: {$ref: #/components/schemas/fly.MachineMetrics}, mounts: {type: array, items: {$ref: #/components/schemas/fly.MachineMount}}, processes: {type: array, items: {$ref: #/components/schemas/fly.MachineProcess}}, restart: {$ref: #/components/schemas/fly.MachineRestart}, schedule: {type: string}, services: {type: array, items: {$ref: #/components/schemas/fly.MachineService}}, size: {type: string, description: Deprecated: use Guest instead}, standbys: {type: array, description: Standbys enable a machine to be a standby for another. In the event of a hardware failure, +the standby machine will be started., items: {type: string}}, statics: {type: array, items: {$ref: #/components/schemas/fly.Static}}, stop_config: {$ref: #/components/schemas/fly.StopConfig}, volumes: {type: array, description: Volumes describe the set of volumes that can be attached to the machine. Used in conjuction +with containers, items: {$ref: #/components/schemas/fly.VolumeConfig}}}}, + }, fly.MachineGuest: OpenApiSchema { + name=fly.MachineGuest, + type=object, + properties={cpu_kind: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineGuest/properties/cpu_kind, + component=OpenApiSchema { + name=cpu_kind, + type=string, + ref=#/components/schemas/fly.MachineGuest/properties/cpu_kind, + node={type: string}, + }, + }, cpus: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineGuest/properties/cpus, + component=OpenApiSchema { + name=cpus, + type=integer, + ref=#/components/schemas/fly.MachineGuest/properties/cpus, + node={type: integer}, + }, + }, gpu_kind: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineGuest/properties/gpu_kind, + component=OpenApiSchema { + name=gpu_kind, + type=string, + ref=#/components/schemas/fly.MachineGuest/properties/gpu_kind, + node={type: string}, + }, + }, gpus: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineGuest/properties/gpus, + component=OpenApiSchema { + name=gpus, + type=integer, + ref=#/components/schemas/fly.MachineGuest/properties/gpus, + node={type: integer}, + }, + }, host_dedication_id: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineGuest/properties/host_dedication_id, + component=OpenApiSchema { + name=host_dedication_id, + type=string, + ref=#/components/schemas/fly.MachineGuest/properties/host_dedication_id, + node={type: string}, + }, + }, kernel_args: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineGuest/properties/kernel_args, + component=OpenApiSchema { + name=kernel_args, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineGuest/properties/kernel_args/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineGuest/properties/kernel_args/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachineGuest/properties/kernel_args, + node={type: array, items: {type: string}}, + }, + }, memory_mb: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineGuest/properties/memory_mb, + component=OpenApiSchema { + name=memory_mb, + type=integer, + ref=#/components/schemas/fly.MachineGuest/properties/memory_mb, + node={type: integer}, + }, + }}, + ref=#/components/schemas/fly.MachineGuest, + node={type: object, properties: {cpu_kind: {type: string}, cpus: {type: integer}, gpu_kind: {type: string}, gpus: {type: integer}, host_dedication_id: {type: string}, kernel_args: {type: array, items: {type: string}}, memory_mb: {type: integer}}}, + }, fly.MachineHTTPHeader: OpenApiSchema { + name=fly.MachineHTTPHeader, + type=object, + properties={name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineHTTPHeader/properties/name, + component=OpenApiSchema { + name=name, + type=string, + description=The header name, + ref=#/components/schemas/fly.MachineHTTPHeader/properties/name, + node={type: string, description: The header name}, + }, + }, values: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineHTTPHeader/properties/values, + component=OpenApiSchema { + name=values, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineHTTPHeader/properties/values/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineHTTPHeader/properties/values/items, + node={type: string}, + }, + }, + description=The header value, + ref=#/components/schemas/fly.MachineHTTPHeader/properties/values, + node={type: array, description: The header value, items: {type: string}}, + }, + }}, + description=For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call., + ref=#/components/schemas/fly.MachineHTTPHeader, + node={type: object, properties: {name: {type: string, description: The header name}, values: {type: array, description: The header value, items: {type: string}}}, description: For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call.}, + }, fly.MachineInit: OpenApiSchema { + name=fly.MachineInit, + type=object, + properties={cmd: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/cmd, + component=OpenApiSchema { + name=cmd, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/cmd/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineInit/properties/cmd/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachineInit/properties/cmd, + node={type: array, items: {type: string}}, + }, + }, entrypoint: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/entrypoint, + component=OpenApiSchema { + name=entrypoint, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/entrypoint/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineInit/properties/entrypoint/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachineInit/properties/entrypoint, + node={type: array, items: {type: string}}, + }, + }, exec: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/exec, + component=OpenApiSchema { + name=exec, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/exec/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineInit/properties/exec/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachineInit/properties/exec, + node={type: array, items: {type: string}}, + }, + }, kernel_args: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/kernel_args, + component=OpenApiSchema { + name=kernel_args, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/kernel_args/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineInit/properties/kernel_args/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachineInit/properties/kernel_args, + node={type: array, items: {type: string}}, + }, + }, swap_size_mb: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/swap_size_mb, + component=OpenApiSchema { + name=swap_size_mb, + type=integer, + ref=#/components/schemas/fly.MachineInit/properties/swap_size_mb, + node={type: integer}, + }, + }, tty: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineInit/properties/tty, + component=OpenApiSchema { + name=tty, + type=boolean, + ref=#/components/schemas/fly.MachineInit/properties/tty, + node={type: boolean}, + }, + }}, + ref=#/components/schemas/fly.MachineInit, + node={type: object, properties: {cmd: {type: array, items: {type: string}}, entrypoint: {type: array, items: {type: string}}, exec: {type: array, items: {type: string}}, kernel_args: {type: array, items: {type: string}}, swap_size_mb: {type: integer}, tty: {type: boolean}}}, + }, fly.MachineMetrics: OpenApiSchema { + name=fly.MachineMetrics, + type=object, + properties={https: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMetrics/properties/https, + component=OpenApiSchema { + name=https, + type=boolean, + ref=#/components/schemas/fly.MachineMetrics/properties/https, + node={type: boolean}, + }, + }, path: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMetrics/properties/path, + component=OpenApiSchema { + name=path, + type=string, + ref=#/components/schemas/fly.MachineMetrics/properties/path, + node={type: string}, + }, + }, port: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMetrics/properties/port, + component=OpenApiSchema { + name=port, + type=integer, + ref=#/components/schemas/fly.MachineMetrics/properties/port, + node={type: integer}, + }, + }}, + ref=#/components/schemas/fly.MachineMetrics, + node={type: object, properties: {https: {type: boolean}, path: {type: string}, port: {type: integer}}}, + }, fly.MachineMount: OpenApiSchema { + name=fly.MachineMount, + type=object, + properties={add_size_gb: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMount/properties/add_size_gb, + component=OpenApiSchema { + name=add_size_gb, + type=integer, + ref=#/components/schemas/fly.MachineMount/properties/add_size_gb, + node={type: integer}, + }, + }, encrypted: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMount/properties/encrypted, + component=OpenApiSchema { + name=encrypted, + type=boolean, + ref=#/components/schemas/fly.MachineMount/properties/encrypted, + node={type: boolean}, + }, + }, extend_threshold_percent: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMount/properties/extend_threshold_percent, + component=OpenApiSchema { + name=extend_threshold_percent, + type=integer, + ref=#/components/schemas/fly.MachineMount/properties/extend_threshold_percent, + node={type: integer}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMount/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/fly.MachineMount/properties/name, + node={type: string}, + }, + }, path: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMount/properties/path, + component=OpenApiSchema { + name=path, + type=string, + ref=#/components/schemas/fly.MachineMount/properties/path, + node={type: string}, + }, + }, size_gb: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMount/properties/size_gb, + component=OpenApiSchema { + name=size_gb, + type=integer, + ref=#/components/schemas/fly.MachineMount/properties/size_gb, + node={type: integer}, + }, + }, size_gb_limit: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMount/properties/size_gb_limit, + component=OpenApiSchema { + name=size_gb_limit, + type=integer, + ref=#/components/schemas/fly.MachineMount/properties/size_gb_limit, + node={type: integer}, + }, + }, volume: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineMount/properties/volume, + component=OpenApiSchema { + name=volume, + type=string, + ref=#/components/schemas/fly.MachineMount/properties/volume, + node={type: string}, + }, + }}, + ref=#/components/schemas/fly.MachineMount, + node={type: object, properties: {add_size_gb: {type: integer}, encrypted: {type: boolean}, extend_threshold_percent: {type: integer}, name: {type: string}, path: {type: string}, size_gb: {type: integer}, size_gb_limit: {type: integer}, volume: {type: string}}}, + }, fly.MachinePort: OpenApiSchema { + name=fly.MachinePort, + type=object, + properties={end_port: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/end_port, + component=OpenApiSchema { + name=end_port, + type=integer, + ref=#/components/schemas/fly.MachinePort/properties/end_port, + node={type: integer}, + }, + }, force_https: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/force_https, + component=OpenApiSchema { + name=force_https, + type=boolean, + ref=#/components/schemas/fly.MachinePort/properties/force_https, + node={type: boolean}, + }, + }, handlers: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/handlers, + component=OpenApiSchema { + name=handlers, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/handlers/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachinePort/properties/handlers/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachinePort/properties/handlers, + node={type: array, items: {type: string}}, + }, + }, http_options: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/http_options, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.HTTPOptions, + name=fly.HTTPOptions, + node={$ref: #/components/schemas/fly.HTTPOptions}, + }, + node={$ref: #/components/schemas/fly.HTTPOptions}, + }, port: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/port, + component=OpenApiSchema { + name=port, + type=integer, + ref=#/components/schemas/fly.MachinePort/properties/port, + node={type: integer}, + }, + }, proxy_proto_options: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/proxy_proto_options, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.ProxyProtoOptions, + name=fly.ProxyProtoOptions, + node={$ref: #/components/schemas/fly.ProxyProtoOptions}, + }, + node={$ref: #/components/schemas/fly.ProxyProtoOptions}, + }, start_port: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/start_port, + component=OpenApiSchema { + name=start_port, + type=integer, + ref=#/components/schemas/fly.MachinePort/properties/start_port, + node={type: integer}, + }, + }, tls_options: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachinePort/properties/tls_options, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.TLSOptions, + name=fly.TLSOptions, + node={$ref: #/components/schemas/fly.TLSOptions}, + }, + node={$ref: #/components/schemas/fly.TLSOptions}, + }}, + ref=#/components/schemas/fly.MachinePort, + node={type: object, properties: {end_port: {type: integer}, force_https: {type: boolean}, handlers: {type: array, items: {type: string}}, http_options: {$ref: #/components/schemas/fly.HTTPOptions}, port: {type: integer}, proxy_proto_options: {$ref: #/components/schemas/fly.ProxyProtoOptions}, start_port: {type: integer}, tls_options: {$ref: #/components/schemas/fly.TLSOptions}}}, + }, fly.MachineProcess: OpenApiSchema { + name=fly.MachineProcess, + type=object, + properties={cmd: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/cmd, + component=OpenApiSchema { + name=cmd, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/cmd/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineProcess/properties/cmd/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachineProcess/properties/cmd, + node={type: array, items: {type: string}}, + }, + }, entrypoint: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/entrypoint, + component=OpenApiSchema { + name=entrypoint, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/entrypoint/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineProcess/properties/entrypoint/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachineProcess/properties/entrypoint, + node={type: array, items: {type: string}}, + }, + }, env: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/env, + component=OpenApiSchema { + name=env, + type=object, + additionalProperties=OpenApiAdditionalProperties { + schema=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/env/additionalProperties, + component=OpenApiSchema { + name=additionalProperties, + type=string, + ref=#/components/schemas/fly.MachineProcess/properties/env/additionalProperties, + node={type: string}, + }, + }, + }, + ref=#/components/schemas/fly.MachineProcess/properties/env, + node={type: object, additionalProperties: {type: string}}, + }, + }, env_from: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/env_from, + component=OpenApiSchema { + name=env_from, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/env_from/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.EnvFrom, + name=fly.EnvFrom, + node={$ref: #/components/schemas/fly.EnvFrom}, + }, + node={$ref: #/components/schemas/fly.EnvFrom}, + }, + description=EnvFrom can be provided to set environment variables from machine fields., + ref=#/components/schemas/fly.MachineProcess/properties/env_from, + node={type: array, description: EnvFrom can be provided to set environment variables from machine fields., items: {$ref: #/components/schemas/fly.EnvFrom}}, + }, + }, exec: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/exec, + component=OpenApiSchema { + name=exec, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/exec/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.MachineProcess/properties/exec/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.MachineProcess/properties/exec, + node={type: array, items: {type: string}}, + }, + }, ignore_app_secrets: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/ignore_app_secrets, + component=OpenApiSchema { + name=ignore_app_secrets, + type=boolean, + description=IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to +and only use the secrets provided at the process level. The default/legacy behavior is to use +the secrets provided at the App level., + ref=#/components/schemas/fly.MachineProcess/properties/ignore_app_secrets, + node={type: boolean, description: IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to +and only use the secrets provided at the process level. The default/legacy behavior is to use +the secrets provided at the App level.}, + }, + }, secrets: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/secrets, + component=OpenApiSchema { + name=secrets, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/secrets/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineSecret, + name=fly.MachineSecret, + node={$ref: #/components/schemas/fly.MachineSecret}, + }, + node={$ref: #/components/schemas/fly.MachineSecret}, + }, + description=Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., + ref=#/components/schemas/fly.MachineProcess/properties/secrets, + node={type: array, description: Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., items: {$ref: #/components/schemas/fly.MachineSecret}}, + }, + }, user: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineProcess/properties/user, + component=OpenApiSchema { + name=user, + type=string, + ref=#/components/schemas/fly.MachineProcess/properties/user, + node={type: string}, + }, + }}, + ref=#/components/schemas/fly.MachineProcess, + node={type: object, properties: {cmd: {type: array, items: {type: string}}, entrypoint: {type: array, items: {type: string}}, env: {type: object, additionalProperties: {type: string}}, env_from: {type: array, description: EnvFrom can be provided to set environment variables from machine fields., items: {$ref: #/components/schemas/fly.EnvFrom}}, exec: {type: array, items: {type: string}}, ignore_app_secrets: {type: boolean, description: IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to +and only use the secrets provided at the process level. The default/legacy behavior is to use +the secrets provided at the App level.}, secrets: {type: array, description: Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., items: {$ref: #/components/schemas/fly.MachineSecret}}, user: {type: string}}}, + }, fly.MachineRestart: OpenApiSchema { + name=fly.MachineRestart, + type=object, + properties={gpu_bid_price: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineRestart/properties/gpu_bid_price, + component=OpenApiSchema { + name=gpu_bid_price, + type=number, + description=GPU bid price for spot Machines., + ref=#/components/schemas/fly.MachineRestart/properties/gpu_bid_price, + node={type: number, description: GPU bid price for spot Machines.}, + }, + }, max_retries: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineRestart/properties/max_retries, + component=OpenApiSchema { + name=max_retries, + type=integer, + description=When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop., + ref=#/components/schemas/fly.MachineRestart/properties/max_retries, + node={type: integer, description: When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.}, + }, + }, policy: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineRestart/properties/policy, + component=OpenApiSchema { + name=policy, + type=string, + enumValues={no, always, on-failure, spot-price}, + description=* no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. +* always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. +* on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. +* spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price., + ref=#/components/schemas/fly.MachineRestart/properties/policy, + node={type: string, description: * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. +* always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. +* on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. +* spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price., enum: [no, always, on-failure, spot-price]}, + }, + }}, + description=The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/., + ref=#/components/schemas/fly.MachineRestart, + node={type: object, properties: {gpu_bid_price: {type: number, description: GPU bid price for spot Machines.}, max_retries: {type: integer, description: When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.}, policy: {type: string, description: * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. +* always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. +* on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. +* spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price., enum: [no, always, on-failure, spot-price]}}, description: The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.}, + }, fly.MachineSecret: OpenApiSchema { + name=fly.MachineSecret, + type=object, + properties={env_var: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineSecret/properties/env_var, + component=OpenApiSchema { + name=env_var, + type=string, + description=EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name., + ref=#/components/schemas/fly.MachineSecret/properties/env_var, + node={type: string, description: EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name.}, + }, + }, name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineSecret/properties/name, + component=OpenApiSchema { + name=name, + type=string, + description=Name is optional and when provided is used to reference a secret name where the EnvVar is +different from what was set as the secret name., + ref=#/components/schemas/fly.MachineSecret/properties/name, + node={type: string, description: Name is optional and when provided is used to reference a secret name where the EnvVar is +different from what was set as the secret name.}, + }, + }}, + description=A Secret needing to be set in the environment of the Machine. env_var is required, + ref=#/components/schemas/fly.MachineSecret, + node={type: object, properties: {env_var: {type: string, description: EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name.}, name: {type: string, description: Name is optional and when provided is used to reference a secret name where the EnvVar is +different from what was set as the secret name.}}, description: A Secret needing to be set in the environment of the Machine. env_var is required}, + }, fly.MachineService: OpenApiSchema { + name=fly.MachineService, + type=object, + properties={autostart: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/autostart, + component=OpenApiSchema { + name=autostart, + type=boolean, + ref=#/components/schemas/fly.MachineService/properties/autostart, + node={type: boolean}, + }, + }, autostop: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/autostop, + component=OpenApiSchema { + name=autostop, + type=string, + enumValues={off, stop, suspend}, + description=Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. +* "off" or false - Do not autostop the Machine. +* "stop" or true - Automatically stop the Machine. +* "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible., + ref=#/components/schemas/fly.MachineService/properties/autostop, + node={type: string, description: Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. +* "off" or false - Do not autostop the Machine. +* "stop" or true - Automatically stop the Machine. +* "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible., enum: [off, stop, suspend]}, + }, + }, checks: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/checks, + component=OpenApiSchema { + name=checks, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/checks/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineCheck, + name=fly.MachineCheck, + node={$ref: #/components/schemas/fly.MachineCheck}, + }, + node={$ref: #/components/schemas/fly.MachineCheck}, + }, + ref=#/components/schemas/fly.MachineService/properties/checks, + node={type: array, items: {$ref: #/components/schemas/fly.MachineCheck}}, + }, + }, concurrency: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/concurrency, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachineServiceConcurrency, + name=fly.MachineServiceConcurrency, + node={$ref: #/components/schemas/fly.MachineServiceConcurrency}, + }, + node={$ref: #/components/schemas/fly.MachineServiceConcurrency}, + }, force_instance_description: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/force_instance_description, + component=OpenApiSchema { + name=force_instance_description, + type=string, + ref=#/components/schemas/fly.MachineService/properties/force_instance_description, + node={type: string}, + }, + }, force_instance_key: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/force_instance_key, + component=OpenApiSchema { + name=force_instance_key, + type=string, + ref=#/components/schemas/fly.MachineService/properties/force_instance_key, + node={type: string}, + }, + }, internal_port: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/internal_port, + component=OpenApiSchema { + name=internal_port, + type=integer, + ref=#/components/schemas/fly.MachineService/properties/internal_port, + node={type: integer}, + }, + }, min_machines_running: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/min_machines_running, + component=OpenApiSchema { + name=min_machines_running, + type=integer, + ref=#/components/schemas/fly.MachineService/properties/min_machines_running, + node={type: integer}, + }, + }, ports: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/ports, + component=OpenApiSchema { + name=ports, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/ports/items, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.MachinePort, + name=fly.MachinePort, + node={$ref: #/components/schemas/fly.MachinePort}, + }, + node={$ref: #/components/schemas/fly.MachinePort}, + }, + ref=#/components/schemas/fly.MachineService/properties/ports, + node={type: array, items: {$ref: #/components/schemas/fly.MachinePort}}, + }, + }, protocol: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineService/properties/protocol, + component=OpenApiSchema { + name=protocol, + type=string, + ref=#/components/schemas/fly.MachineService/properties/protocol, + node={type: string}, + }, + }}, + ref=#/components/schemas/fly.MachineService, + node={type: object, properties: {autostart: {type: boolean}, autostop: {type: string, description: Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. +* "off" or false - Do not autostop the Machine. +* "stop" or true - Automatically stop the Machine. +* "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible., enum: [off, stop, suspend]}, checks: {type: array, items: {$ref: #/components/schemas/fly.MachineCheck}}, concurrency: {$ref: #/components/schemas/fly.MachineServiceConcurrency}, force_instance_description: {type: string}, force_instance_key: {type: string}, internal_port: {type: integer}, min_machines_running: {type: integer}, ports: {type: array, items: {$ref: #/components/schemas/fly.MachinePort}}, protocol: {type: string}}}, + }, fly.MachineServiceConcurrency: OpenApiSchema { + name=fly.MachineServiceConcurrency, + type=object, + properties={hard_limit: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineServiceConcurrency/properties/hard_limit, + component=OpenApiSchema { + name=hard_limit, + type=integer, + ref=#/components/schemas/fly.MachineServiceConcurrency/properties/hard_limit, + node={type: integer}, + }, + }, soft_limit: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineServiceConcurrency/properties/soft_limit, + component=OpenApiSchema { + name=soft_limit, + type=integer, + ref=#/components/schemas/fly.MachineServiceConcurrency/properties/soft_limit, + node={type: integer}, + }, + }, type: OpenApiComponentOrRef { + ref=#/components/schemas/fly.MachineServiceConcurrency/properties/type, + component=OpenApiSchema { + name=type, + type=string, + ref=#/components/schemas/fly.MachineServiceConcurrency/properties/type, + node={type: string}, + }, + }}, + ref=#/components/schemas/fly.MachineServiceConcurrency, + node={type: object, properties: {hard_limit: {type: integer}, soft_limit: {type: integer}, type: {type: string}}}, + }, fly.ProxyProtoOptions: OpenApiSchema { + name=fly.ProxyProtoOptions, + type=object, + properties={version: OpenApiComponentOrRef { + ref=#/components/schemas/fly.ProxyProtoOptions/properties/version, + component=OpenApiSchema { + name=version, + type=string, + ref=#/components/schemas/fly.ProxyProtoOptions/properties/version, + node={type: string}, + }, + }}, + ref=#/components/schemas/fly.ProxyProtoOptions, + node={type: object, properties: {version: {type: string}}}, + }, fly.Static: OpenApiSchema { + name=fly.Static, + type=object, + properties={guest_path: OpenApiComponentOrRef { + ref=#/components/schemas/fly.Static/properties/guest_path, + component=OpenApiSchema { + name=guest_path, + type=string, + ref=#/components/schemas/fly.Static/properties/guest_path, + node={type: string}, + }, + }, index_document: OpenApiComponentOrRef { + ref=#/components/schemas/fly.Static/properties/index_document, + component=OpenApiSchema { + name=index_document, + type=string, + ref=#/components/schemas/fly.Static/properties/index_document, + node={type: string}, + }, + }, tigris_bucket: OpenApiComponentOrRef { + ref=#/components/schemas/fly.Static/properties/tigris_bucket, + component=OpenApiSchema { + name=tigris_bucket, + type=string, + ref=#/components/schemas/fly.Static/properties/tigris_bucket, + node={type: string}, + }, + }, url_prefix: OpenApiComponentOrRef { + ref=#/components/schemas/fly.Static/properties/url_prefix, + component=OpenApiSchema { + name=url_prefix, + type=string, + ref=#/components/schemas/fly.Static/properties/url_prefix, + node={type: string}, + }, + }}, + required={guest_path, url_prefix}, + ref=#/components/schemas/fly.Static, + node={required: [guest_path, url_prefix], type: object, properties: {guest_path: {type: string}, index_document: {type: string}, tigris_bucket: {type: string}, url_prefix: {type: string}}}, + }, fly.StopConfig: OpenApiSchema { + name=fly.StopConfig, + type=object, + properties={signal: OpenApiComponentOrRef { + ref=#/components/schemas/fly.StopConfig/properties/signal, + component=OpenApiSchema { + name=signal, + type=string, + ref=#/components/schemas/fly.StopConfig/properties/signal, + node={type: string}, + }, + }, timeout: OpenApiComponentOrRef { + ref=#/components/schemas/fly.StopConfig/properties/timeout, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.Duration, + name=fly.Duration, + node={$ref: #/components/schemas/fly.Duration}, + }, + node={$ref: #/components/schemas/fly.Duration}, + }}, + ref=#/components/schemas/fly.StopConfig, + node={type: object, properties: {signal: {type: string}, timeout: {$ref: #/components/schemas/fly.Duration}}}, + }, fly.TCPHealthcheck: OpenApiSchema { + name=fly.TCPHealthcheck, + type=object, + properties={port: OpenApiComponentOrRef { + ref=#/components/schemas/fly.TCPHealthcheck/properties/port, + component=OpenApiSchema { + name=port, + type=integer, + description=The port to connect to, often the same as internal_port, + ref=#/components/schemas/fly.TCPHealthcheck/properties/port, + node={type: integer, description: The port to connect to, often the same as internal_port}, + }, + }}, + ref=#/components/schemas/fly.TCPHealthcheck, + node={type: object, properties: {port: {type: integer, description: The port to connect to, often the same as internal_port}}}, + }, fly.TLSOptions: OpenApiSchema { + name=fly.TLSOptions, + type=object, + properties={alpn: OpenApiComponentOrRef { + ref=#/components/schemas/fly.TLSOptions/properties/alpn, + component=OpenApiSchema { + name=alpn, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.TLSOptions/properties/alpn/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.TLSOptions/properties/alpn/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.TLSOptions/properties/alpn, + node={type: array, items: {type: string}}, + }, + }, default_self_signed: OpenApiComponentOrRef { + ref=#/components/schemas/fly.TLSOptions/properties/default_self_signed, + component=OpenApiSchema { + name=default_self_signed, + type=boolean, + ref=#/components/schemas/fly.TLSOptions/properties/default_self_signed, + node={type: boolean}, + }, + }, versions: OpenApiComponentOrRef { + ref=#/components/schemas/fly.TLSOptions/properties/versions, + component=OpenApiSchema { + name=versions, + type=array, + items=OpenApiComponentOrRef { + ref=#/components/schemas/fly.TLSOptions/properties/versions/items, + component=OpenApiSchema { + name=items, + type=string, + ref=#/components/schemas/fly.TLSOptions/properties/versions/items, + node={type: string}, + }, + }, + ref=#/components/schemas/fly.TLSOptions/properties/versions, + node={type: array, items: {type: string}}, + }, + }}, + ref=#/components/schemas/fly.TLSOptions, + node={type: object, properties: {alpn: {type: array, items: {type: string}}, default_self_signed: {type: boolean}, versions: {type: array, items: {type: string}}}}, + }, fly.TempDirVolume: OpenApiSchema { + name=fly.TempDirVolume, + type=object, + properties={size_mb: OpenApiComponentOrRef { + ref=#/components/schemas/fly.TempDirVolume/properties/size_mb, + component=OpenApiSchema { + name=size_mb, + type=integer, + description=The size limit of the temp dir, only applicable when using disk backed storage., + ref=#/components/schemas/fly.TempDirVolume/properties/size_mb, + node={type: integer, description: The size limit of the temp dir, only applicable when using disk backed storage.}, + }, + }, storage_type: OpenApiComponentOrRef { + ref=#/components/schemas/fly.TempDirVolume/properties/storage_type, + component=OpenApiSchema { + name=storage_type, + type=string, + description=The type of storage used to back the temp dir. Either disk or memory., + ref=#/components/schemas/fly.TempDirVolume/properties/storage_type, + node={type: string, description: The type of storage used to back the temp dir. Either disk or memory.}, + }, + }}, + ref=#/components/schemas/fly.TempDirVolume, + node={type: object, properties: {size_mb: {type: integer, description: The size limit of the temp dir, only applicable when using disk backed storage.}, storage_type: {type: string, description: The type of storage used to back the temp dir. Either disk or memory.}}}, + }, fly.UnhealthyPolicy: OpenApiSchema { + name=fly.UnhealthyPolicy, + type=string, + enumValues={stop}, + ref=#/components/schemas/fly.UnhealthyPolicy, + node={type: string, enum: [stop], x-enum-varnames: [UnhealthyPolicyStop]}, + extensions={x-enum-varnames: [UnhealthyPolicyStop]}, + }, fly.VolumeConfig: OpenApiSchema { + name=fly.VolumeConfig, + type=object, + properties={name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.VolumeConfig/properties/name, + component=OpenApiSchema { + name=name, + type=string, + description=The name of the volume. A volume must have a unique name within an app, + ref=#/components/schemas/fly.VolumeConfig/properties/name, + node={type: string, description: The name of the volume. A volume must have a unique name within an app}, + }, + }, temp_dir: OpenApiComponentOrRef { + ref=#/components/schemas/fly.VolumeConfig/properties/temp_dir, + reference=OpenApiSchemaReference { + ref=#/components/schemas/fly.TempDirVolume, + name=fly.TempDirVolume, + node={$ref: #/components/schemas/fly.TempDirVolume}, + }, + node={$ref: #/components/schemas/fly.TempDirVolume}, + }}, + ref=#/components/schemas/fly.VolumeConfig, + node={type: object, properties: {name: {type: string, description: The name of the volume. A volume must have a unique name within an app}, temp_dir: {$ref: #/components/schemas/fly.TempDirVolume}}}, + }, fly.dnsForwardRule: OpenApiSchema { + name=fly.dnsForwardRule, + type=object, + properties={addr: OpenApiComponentOrRef { + ref=#/components/schemas/fly.dnsForwardRule/properties/addr, + component=OpenApiSchema { + name=addr, + type=string, + ref=#/components/schemas/fly.dnsForwardRule/properties/addr, + node={type: string}, + }, + }, basename: OpenApiComponentOrRef { + ref=#/components/schemas/fly.dnsForwardRule/properties/basename, + component=OpenApiSchema { + name=basename, + type=string, + ref=#/components/schemas/fly.dnsForwardRule/properties/basename, + node={type: string}, + }, + }}, + ref=#/components/schemas/fly.dnsForwardRule, + node={type: object, properties: {addr: {type: string}, basename: {type: string}}}, + }, fly.dnsOption: OpenApiSchema { + name=fly.dnsOption, + type=object, + properties={name: OpenApiComponentOrRef { + ref=#/components/schemas/fly.dnsOption/properties/name, + component=OpenApiSchema { + name=name, + type=string, + ref=#/components/schemas/fly.dnsOption/properties/name, + node={type: string}, + }, + }, value: OpenApiComponentOrRef { + ref=#/components/schemas/fly.dnsOption/properties/value, + component=OpenApiSchema { + name=value, + type=string, + ref=#/components/schemas/fly.dnsOption/properties/value, + node={type: string}, + }, + }}, + ref=#/components/schemas/fly.dnsOption, + node={type: object, properties: {name: {type: string}, value: {type: string}}}, + }, flydv1.ExecResponse: OpenApiSchema { + name=flydv1.ExecResponse, + type=object, + properties={exit_code: OpenApiComponentOrRef { + ref=#/components/schemas/flydv1.ExecResponse/properties/exit_code, + component=OpenApiSchema { + name=exit_code, + type=integer, + ref=#/components/schemas/flydv1.ExecResponse/properties/exit_code, + node={type: integer}, + }, + }, exit_signal: OpenApiComponentOrRef { + ref=#/components/schemas/flydv1.ExecResponse/properties/exit_signal, + component=OpenApiSchema { + name=exit_signal, + type=integer, + ref=#/components/schemas/flydv1.ExecResponse/properties/exit_signal, + node={type: integer}, + }, + }, stderr: OpenApiComponentOrRef { + ref=#/components/schemas/flydv1.ExecResponse/properties/stderr, + component=OpenApiSchema { + name=stderr, + type=string, + ref=#/components/schemas/flydv1.ExecResponse/properties/stderr, + node={type: string}, + }, + }, stdout: OpenApiComponentOrRef { + ref=#/components/schemas/flydv1.ExecResponse/properties/stdout, + component=OpenApiSchema { + name=stdout, + type=string, + ref=#/components/schemas/flydv1.ExecResponse/properties/stdout, + node={type: string}, + }, + }}, + ref=#/components/schemas/flydv1.ExecResponse, + node={type: object, properties: {exit_code: {type: integer}, exit_signal: {type: integer}, stderr: {type: string}, stdout: {type: string}}}, + }, main.statusCode: OpenApiSchema { + name=main.statusCode, + type=string, + enumValues={unknown, insufficient_capacity}, + ref=#/components/schemas/main.statusCode, + node={type: string, enum: [unknown, insufficient_capacity], x-enum-varnames: [unknown, capacityErr]}, + extensions={x-enum-varnames: [unknown, capacityErr]}, + }}, + responses={}, + parameters={}, + requestBodies={}, + headers={}, + securitySchemes={}, + paths={}, + ref=#/components, + node={schemas: {App: {type: object, properties: {id: {type: string}, name: {type: string}, organization: {$ref: #/components/schemas/Organization}, status: {type: string}}}, CheckStatus: {type: object, properties: {name: {type: string}, output: {type: string}, status: {type: string}, updated_at: {type: string}}}, CreateAppRequest: {type: object, properties: {app_name: {type: string}, enable_subdomains: {type: boolean}, network: {type: string}, org_slug: {type: string}}}, CreateLeaseRequest: {type: object, properties: {description: {type: string}, ttl: {type: integer, description: seconds lease will be valid}}}, CreateMachineRequest: {type: object, properties: {config: {type: object, description: An object defining the Machine configuration, allOf: [{$ref: #/components/schemas/fly.MachineConfig}]}, lease_ttl: {type: integer}, lsvd: {type: boolean}, name: {type: string, description: Unique name for this Machine. If omitted, one is generated for you}, region: {type: string, description: The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).}, skip_launch: {type: boolean}, skip_service_registration: {type: boolean}}}, CreateOIDCTokenRequest: {type: object, properties: {aud: {type: string, example: https://fly.io/org-slug}, aws_principal_tags: {type: boolean}}, description: Optional parameters}, CreateSecretRequest: {type: object, properties: {value: {type: array, items: {type: integer}}}}, CreateVolumeRequest: {type: object, properties: {compute: {$ref: #/components/schemas/fly.MachineGuest}, compute_image: {type: string}, encrypted: {type: boolean}, fstype: {type: string}, name: {type: string}, region: {type: string}, require_unique_zone: {type: boolean}, size_gb: {type: integer}, snapshot_id: {type: string, description: restore from snapshot}, snapshot_retention: {type: integer}, source_volume_id: {type: string, description: fork from remote volume}, unique_zone_app_wide: {type: boolean}}}, ErrorResponse: {type: object, properties: {details: {type: object, description: Deprecated}, error: {type: string}, status: {$ref: #/components/schemas/main.statusCode}}}, ExtendVolumeRequest: {type: object, properties: {size_gb: {type: integer}}}, ExtendVolumeResponse: {type: object, properties: {needs_restart: {type: boolean}, volume: {$ref: #/components/schemas/Volume}}}, ImageRef: {type: object, properties: {digest: {type: string}, labels: {type: object, additionalProperties: {type: string}}, registry: {type: string}, repository: {type: string}, tag: {type: string}}}, Lease: {type: object, properties: {description: {type: string, description: Description or reason for the Lease.}, expires_at: {type: integer, description: ExpiresAt is the unix timestamp in UTC to denote when the Lease will no longer be valid.}, nonce: {type: string, description: Nonce is the unique ID autogenerated and associated with the Lease.}, owner: {type: string, description: Owner is the user identifier which acquired the Lease.}, version: {type: string, description: Machine version}}}, ListApp: {type: object, properties: {id: {type: string}, machine_count: {type: integer}, name: {type: string}, network: {type: object}}}, ListAppsResponse: {type: object, properties: {apps: {type: array, items: {$ref: #/components/schemas/ListApp}}, total_apps: {type: integer}}}, ListSecret: {type: object, properties: {label: {type: string}, publickey: {type: array, items: {type: integer}}, type: {type: string}}}, ListenSocket: {type: object, properties: {address: {type: string}, proto: {type: string}}}, Machine: {type: object, properties: {checks: {type: array, items: {$ref: #/components/schemas/CheckStatus}}, config: {$ref: #/components/schemas/fly.MachineConfig}, created_at: {type: string}, events: {type: array, items: {$ref: #/components/schemas/MachineEvent}}, host_status: {type: string, enum: [ok, unknown, unreachable]}, id: {type: string}, image_ref: {$ref: #/components/schemas/ImageRef}, incomplete_config: {$ref: #/components/schemas/fly.MachineConfig}, instance_id: {type: string, description: InstanceID is unique for each version of the machine}, name: {type: string}, nonce: {type: string, description: Nonce is only every returned on machine creation if a lease_duration was provided.}, private_ip: {type: string, description: PrivateIP is the internal 6PN address of the machine.}, region: {type: string}, state: {type: string}, updated_at: {type: string}}}, MachineEvent: {type: object, properties: {id: {type: string}, request: {type: object}, source: {type: string}, status: {type: string}, timestamp: {type: integer}, type: {type: string}}}, MachineExecRequest: {type: object, properties: {cmd: {type: string, description: Deprecated: use Command instead}, command: {type: array, items: {type: string}}, container: {type: string}, stdin: {type: string}, timeout: {type: integer}}}, MachineVersion: {type: object, properties: {user_config: {$ref: #/components/schemas/fly.MachineConfig}, version: {type: string}}}, Organization: {type: object, properties: {name: {type: string}, slug: {type: string}}}, ProcessStat: {type: object, properties: {command: {type: string}, cpu: {type: integer}, directory: {type: string}, listen_sockets: {type: array, items: {$ref: #/components/schemas/ListenSocket}}, pid: {type: integer}, rss: {type: integer}, rtime: {type: integer}, stime: {type: integer}}}, SignalRequest: {type: object, properties: {signal: {type: string, enum: [SIGABRT, SIGALRM, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGTERM, SIGTRAP, SIGUSR1]}}}, StopRequest: {type: object, properties: {signal: {type: string}, timeout: {$ref: #/components/schemas/fly.Duration}}}, UpdateMachineRequest: {type: object, properties: {config: {type: object, description: An object defining the Machine configuration, allOf: [{$ref: #/components/schemas/fly.MachineConfig}]}, current_version: {type: string}, lease_ttl: {type: integer}, lsvd: {type: boolean}, name: {type: string, description: Unique name for this Machine. If omitted, one is generated for you}, region: {type: string, description: The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).}, skip_launch: {type: boolean}, skip_service_registration: {type: boolean}}}, UpdateVolumeRequest: {type: object, properties: {auto_backup_enabled: {type: boolean}, snapshot_retention: {type: integer}}}, Volume: {type: object, properties: {attached_alloc_id: {type: string}, attached_machine_id: {type: string}, auto_backup_enabled: {type: boolean}, block_size: {type: integer}, blocks: {type: integer}, blocks_avail: {type: integer}, blocks_free: {type: integer}, created_at: {type: string}, encrypted: {type: boolean}, fstype: {type: string}, host_status: {type: string, enum: [ok, unknown, unreachable]}, id: {type: string}, name: {type: string}, region: {type: string}, size_gb: {type: integer}, snapshot_retention: {type: integer}, state: {type: string}, zone: {type: string}}}, VolumeSnapshot: {type: object, properties: {created_at: {type: string}, digest: {type: string}, id: {type: string}, retention_days: {type: integer}, size: {type: integer}, status: {type: string}}}, fly.ContainerConfig: {type: object, properties: {cmd: {type: array, description: CmdOverride is used to override the default command of the image., items: {type: string}}, depends_on: {type: array, description: DependsOn can be used to define dependencies between containers. The container will only be +started after all of its dependent conditions have been satisfied., items: {$ref: #/components/schemas/fly.ContainerDependency}}, entrypoint: {type: array, description: EntrypointOverride is used to override the default entrypoint of the image., items: {type: string}}, env: {type: object, additionalProperties: {type: string}, description: ExtraEnv is used to add additional environment variables to the container.}, env_from: {type: array, description: EnvFrom can be provided to set environment variables from machine fields., items: {$ref: #/components/schemas/fly.EnvFrom}}, exec: {type: array, description: Image Config overrides - these fields are used to override the image configuration. +If not provided, the image configuration will be used. +ExecOverride is used to override the default command of the image., items: {type: string}}, files: {type: array, description: Files are files that will be written to the container file system., items: {$ref: #/components/schemas/fly.File}}, healthchecks: {type: array, description: Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command., items: {$ref: #/components/schemas/fly.ContainerHealthcheck}}, image: {type: string, description: Image is the docker image to run.}, mounts: {type: array, description: Set of mounts added to the container. These must reference a volume in the machine config via its name., items: {$ref: #/components/schemas/fly.ContainerMount}}, name: {type: string, description: Name is used to identify the container in the machine.}, restart: {type: object, description: Restart is used to define the restart policy for the container. NOTE: spot-price is not +supported for containers., allOf: [{$ref: #/components/schemas/fly.MachineRestart}]}, secrets: {type: array, description: Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., items: {$ref: #/components/schemas/fly.MachineSecret}}, stop: {type: object, description: Stop is used to define the signal and timeout for stopping the container., allOf: [{$ref: #/components/schemas/fly.StopConfig}]}, user: {type: string, description: UserOverride is used to override the default user of the image.}}}, fly.ContainerDependency: {type: object, properties: {condition: {type: object, allOf: [{$ref: #/components/schemas/fly.ContainerDependencyCondition}]}, name: {type: string}}}, fly.ContainerDependencyCondition: {type: string, enum: [exited_successfully, healthy, started], x-enum-varnames: [ExitedSuccessfully, Healthy, Started]}, fly.ContainerHealthcheck: {type: object, properties: {exec: {$ref: #/components/schemas/fly.ExecHealthcheck}, failure_threshold: {type: integer, description: The number of times the check must fail before considering the container unhealthy.}, grace_period: {type: integer, description: The time in seconds to wait after a container starts before checking its health.}, http: {$ref: #/components/schemas/fly.HTTPHealthcheck}, interval: {type: integer, description: The time in seconds between executing the defined check.}, kind: {type: object, description: Kind of healthcheck (readiness, liveness), allOf: [{$ref: #/components/schemas/fly.ContainerHealthcheckKind}]}, name: {type: string, description: The name of the check. Must be unique within the container.}, success_threshold: {type: integer, description: The number of times the check must succeeed before considering the container healthy.}, tcp: {$ref: #/components/schemas/fly.TCPHealthcheck}, timeout: {type: integer, description: The time in seconds to wait for the check to complete.}, unhealthy: {type: object, description: Unhealthy policy that determines what action to take if a container is deemed unhealthy, allOf: [{$ref: #/components/schemas/fly.UnhealthyPolicy}]}}}, fly.ContainerHealthcheckKind: {type: string, enum: [readiness, liveness], x-enum-varnames: [Readiness, Liveness]}, fly.ContainerHealthcheckScheme: {type: string, enum: [http, https], x-enum-varnames: [HTTP, HTTPS]}, fly.ContainerMount: {type: object, properties: {name: {type: string, description: The name of the volume. Must exist in the volumes field in the machine configuration}, path: {type: string, description: The path to mount the volume within the container}}}, fly.DNSConfig: {type: object, properties: {dns_forward_rules: {type: array, items: {$ref: #/components/schemas/fly.dnsForwardRule}}, hostname: {type: string}, hostname_fqdn: {type: string}, nameservers: {type: array, items: {type: string}}, options: {type: array, items: {$ref: #/components/schemas/fly.dnsOption}}, searches: {type: array, items: {type: string}}, skip_registration: {type: boolean}}}, fly.Duration: {type: object, properties: {time.Duration: {type: integer, x-enum-varnames: [minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour]}}}, fly.EnvFrom: {type: object, properties: {env_var: {type: string, description: EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name.}, field_ref: {type: string, description: FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image., enum: [id, version, app_name, private_ip, region, image]}}, description: EnvVar defines an environment variable to be populated from a machine field, env_var}, fly.ExecHealthcheck: {type: object, properties: {command: {type: array, description: The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"]), items: {type: string}}}}, fly.File: {type: object, properties: {guest_path: {type: string, description: GuestPath is the path on the machine where the file will be written and must be an absolute path. +For example: /full/path/to/file.json}, mode: {type: integer, description: Mode bits used to set permissions on this file as accepted by chmod(2).}, raw_value: {type: string, description: The base64 encoded string of the file contents.}, secret_name: {type: string, description: The name of the secret that contains the base64 encoded file contents.}}, description: A file that will be written to the Machine. One of RawValue or SecretName must be set.}, fly.HTTPHealthcheck: {type: object, properties: {headers: {type: array, description: Additional headers to send with the request, items: {$ref: #/components/schemas/fly.MachineHTTPHeader}}, method: {type: string, description: The HTTP method to use to when making the request}, path: {type: string, description: The path to send the request to}, port: {type: integer, description: The port to connect to, often the same as internal_port}, scheme: {type: object, description: Whether to use http or https, allOf: [{$ref: #/components/schemas/fly.ContainerHealthcheckScheme}]}, tls_server_name: {type: string, description: If the protocol is https, the hostname to use for TLS certificate validation}, tls_skip_verify: {type: boolean, description: If the protocol is https, whether or not to verify the TLS certificate}}}, fly.HTTPOptions: {type: object, properties: {compress: {type: boolean}, h2_backend: {type: boolean}, headers_read_timeout: {type: integer}, idle_timeout: {type: integer}, response: {$ref: #/components/schemas/fly.HTTPResponseOptions}}}, fly.HTTPResponseOptions: {type: object, properties: {headers: {type: object, additionalProperties: {type: object}}, pristine: {type: boolean}}}, fly.MachineCheck: {type: object, properties: {grace_period: {type: object, description: The time to wait after a VM starts before checking its health, allOf: [{$ref: #/components/schemas/fly.Duration}]}, headers: {type: array, items: {$ref: #/components/schemas/fly.MachineHTTPHeader}}, interval: {type: object, description: The time between connectivity checks, allOf: [{$ref: #/components/schemas/fly.Duration}]}, kind: {type: string, description: Kind of the check (informational, readiness), enum: [informational, readiness]}, method: {type: string, description: For http checks, the HTTP method to use to when making the request}, path: {type: string, description: For http checks, the path to send the request to}, port: {type: integer, description: The port to connect to, often the same as internal_port}, protocol: {type: string, description: For http checks, whether to use http or https}, timeout: {type: object, description: The maximum time a connection can take before being reported as failing its health check, allOf: [{$ref: #/components/schemas/fly.Duration}]}, tls_server_name: {type: string, description: If the protocol is https, the hostname to use for TLS certificate validation}, tls_skip_verify: {type: boolean, description: For http checks with https protocol, whether or not to verify the TLS certificate}, type: {type: string, description: tcp or http}}, description: An optional object that defines one or more named checks. The key for each check is the check name.}, fly.MachineConfig: {type: object, properties: {auto_destroy: {type: boolean, description: Optional boolean telling the Machine to destroy itself once it’s complete (default false)}, checks: {type: object, additionalProperties: {$ref: #/components/schemas/fly.MachineCheck}}, containers: {type: array, description: Containers are a list of containers that will run in the machine. Currently restricted to +only specific organizations., items: {$ref: #/components/schemas/fly.ContainerConfig}}, disable_machine_autostart: {type: boolean, description: Deprecated: use Service.Autostart instead}, dns: {$ref: #/components/schemas/fly.DNSConfig}, env: {type: object, additionalProperties: {type: string}, description: An object filled with key/value pairs to be set as environment variables}, files: {type: array, items: {$ref: #/components/schemas/fly.File}}, guest: {$ref: #/components/schemas/fly.MachineGuest}, image: {type: string, description: The docker image to run}, init: {$ref: #/components/schemas/fly.MachineInit}, metadata: {type: object, additionalProperties: {type: string}}, metrics: {$ref: #/components/schemas/fly.MachineMetrics}, mounts: {type: array, items: {$ref: #/components/schemas/fly.MachineMount}}, processes: {type: array, items: {$ref: #/components/schemas/fly.MachineProcess}}, restart: {$ref: #/components/schemas/fly.MachineRestart}, schedule: {type: string}, services: {type: array, items: {$ref: #/components/schemas/fly.MachineService}}, size: {type: string, description: Deprecated: use Guest instead}, standbys: {type: array, description: Standbys enable a machine to be a standby for another. In the event of a hardware failure, +the standby machine will be started., items: {type: string}}, statics: {type: array, items: {$ref: #/components/schemas/fly.Static}}, stop_config: {$ref: #/components/schemas/fly.StopConfig}, volumes: {type: array, description: Volumes describe the set of volumes that can be attached to the machine. Used in conjuction +with containers, items: {$ref: #/components/schemas/fly.VolumeConfig}}}}, fly.MachineGuest: {type: object, properties: {cpu_kind: {type: string}, cpus: {type: integer}, gpu_kind: {type: string}, gpus: {type: integer}, host_dedication_id: {type: string}, kernel_args: {type: array, items: {type: string}}, memory_mb: {type: integer}}}, fly.MachineHTTPHeader: {type: object, properties: {name: {type: string, description: The header name}, values: {type: array, description: The header value, items: {type: string}}}, description: For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call.}, fly.MachineInit: {type: object, properties: {cmd: {type: array, items: {type: string}}, entrypoint: {type: array, items: {type: string}}, exec: {type: array, items: {type: string}}, kernel_args: {type: array, items: {type: string}}, swap_size_mb: {type: integer}, tty: {type: boolean}}}, fly.MachineMetrics: {type: object, properties: {https: {type: boolean}, path: {type: string}, port: {type: integer}}}, fly.MachineMount: {type: object, properties: {add_size_gb: {type: integer}, encrypted: {type: boolean}, extend_threshold_percent: {type: integer}, name: {type: string}, path: {type: string}, size_gb: {type: integer}, size_gb_limit: {type: integer}, volume: {type: string}}}, fly.MachinePort: {type: object, properties: {end_port: {type: integer}, force_https: {type: boolean}, handlers: {type: array, items: {type: string}}, http_options: {$ref: #/components/schemas/fly.HTTPOptions}, port: {type: integer}, proxy_proto_options: {$ref: #/components/schemas/fly.ProxyProtoOptions}, start_port: {type: integer}, tls_options: {$ref: #/components/schemas/fly.TLSOptions}}}, fly.MachineProcess: {type: object, properties: {cmd: {type: array, items: {type: string}}, entrypoint: {type: array, items: {type: string}}, env: {type: object, additionalProperties: {type: string}}, env_from: {type: array, description: EnvFrom can be provided to set environment variables from machine fields., items: {$ref: #/components/schemas/fly.EnvFrom}}, exec: {type: array, items: {type: string}}, ignore_app_secrets: {type: boolean, description: IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to +and only use the secrets provided at the process level. The default/legacy behavior is to use +the secrets provided at the App level.}, secrets: {type: array, description: Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., items: {$ref: #/components/schemas/fly.MachineSecret}}, user: {type: string}}}, fly.MachineRestart: {type: object, properties: {gpu_bid_price: {type: number, description: GPU bid price for spot Machines.}, max_retries: {type: integer, description: When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.}, policy: {type: string, description: * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. +* always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. +* on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. +* spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price., enum: [no, always, on-failure, spot-price]}}, description: The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.}, fly.MachineSecret: {type: object, properties: {env_var: {type: string, description: EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name.}, name: {type: string, description: Name is optional and when provided is used to reference a secret name where the EnvVar is +different from what was set as the secret name.}}, description: A Secret needing to be set in the environment of the Machine. env_var is required}, fly.MachineService: {type: object, properties: {autostart: {type: boolean}, autostop: {type: string, description: Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. +* "off" or false - Do not autostop the Machine. +* "stop" or true - Automatically stop the Machine. +* "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible., enum: [off, stop, suspend]}, checks: {type: array, items: {$ref: #/components/schemas/fly.MachineCheck}}, concurrency: {$ref: #/components/schemas/fly.MachineServiceConcurrency}, force_instance_description: {type: string}, force_instance_key: {type: string}, internal_port: {type: integer}, min_machines_running: {type: integer}, ports: {type: array, items: {$ref: #/components/schemas/fly.MachinePort}}, protocol: {type: string}}}, fly.MachineServiceConcurrency: {type: object, properties: {hard_limit: {type: integer}, soft_limit: {type: integer}, type: {type: string}}}, fly.ProxyProtoOptions: {type: object, properties: {version: {type: string}}}, fly.Static: {required: [guest_path, url_prefix], type: object, properties: {guest_path: {type: string}, index_document: {type: string}, tigris_bucket: {type: string}, url_prefix: {type: string}}}, fly.StopConfig: {type: object, properties: {signal: {type: string}, timeout: {$ref: #/components/schemas/fly.Duration}}}, fly.TCPHealthcheck: {type: object, properties: {port: {type: integer, description: The port to connect to, often the same as internal_port}}}, fly.TLSOptions: {type: object, properties: {alpn: {type: array, items: {type: string}}, default_self_signed: {type: boolean}, versions: {type: array, items: {type: string}}}}, fly.TempDirVolume: {type: object, properties: {size_mb: {type: integer, description: The size limit of the temp dir, only applicable when using disk backed storage.}, storage_type: {type: string, description: The type of storage used to back the temp dir. Either disk or memory.}}}, fly.UnhealthyPolicy: {type: string, enum: [stop], x-enum-varnames: [UnhealthyPolicyStop]}, fly.VolumeConfig: {type: object, properties: {name: {type: string, description: The name of the volume. A volume must have a unique name within an app}, temp_dir: {$ref: #/components/schemas/fly.TempDirVolume}}}, fly.dnsForwardRule: {type: object, properties: {addr: {type: string}, basename: {type: string}}}, fly.dnsOption: {type: object, properties: {name: {type: string}, value: {type: string}}}, flydv1.ExecResponse: {type: object, properties: {exit_code: {type: integer}, exit_signal: {type: integer}, stderr: {type: string}, stdout: {type: string}}}, main.statusCode: {type: string, enum: [unknown, insufficient_capacity], x-enum-varnames: [unknown, capacityErr]}}}, + }, + securityRequirements=[], + externalDocs=OpenApiExternalDocs { + url=https://fly.io/docs/machines/working-with-machines/, + ref=#/externalDocs, + node={url: https://fly.io/docs/machines/working-with-machines/}, + }, + tags=[OpenApiTag { + name=Apps, + description=This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource., + ref=#/tags/0, + node={name: Apps, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource.}, + }, OpenApiTag { + name=Machines, + description=This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/machines-resource/) for details about using the Machines resource., + ref=#/tags/1, + node={name: Machines, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/machines-resource/) for details about using the Machines resource.}, + }, OpenApiTag { + name=Volumes, + description=This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/volumes-resource/) for details about using the Volumes resource., + ref=#/tags/2, + node={name: Volumes, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/volumes-resource/) for details about using the Volumes resource.}, + }], + ref=#, + node={openapi: 3.0.1, info: {title: Machines API, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/) for how to get started, more information about each endpoint, parameter descriptions, and examples., contact: {}, license: {name: Apache 2.0, url: http://www.apache.org/licenses/LICENSE-2.0.html}, version: 1.0}, externalDocs: {url: https://fly.io/docs/machines/working-with-machines/}, servers: [{url: https://api.machines.dev/v1}], tags: [{name: Apps, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource.}, {name: Machines, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/machines-resource/) for details about using the Machines resource.}, {name: Volumes, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/volumes-resource/) for details about using the Volumes resource.}], paths: {/apps: {get: {tags: [Apps], summary: List Apps, description: List all apps with the ability to filter by organization slug. +, operationId: Apps_list, parameters: [{name: org_slug, in: query, description: The org slug, or 'personal', to filter apps, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/ListAppsResponse}}}}}}, post: {tags: [Apps], summary: Create App, description: Create an app with the specified details in the request body. +, operationId: Apps_create, requestBody: {description: App body, content: {application/json: {schema: {$ref: #/components/schemas/CreateAppRequest}}}, required: true}, responses: {201: {description: Created, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, /apps/{app_name}: {get: {tags: [Apps], summary: Get App, description: Retrieve details about a specific app by its name. +, operationId: Apps_show, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/App}}}}}}, delete: {tags: [Apps], summary: Destroy App, description: Delete an app by its name. +, operationId: Apps_delete, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], responses: {202: {description: Accepted, content: {}}}}}, /apps/{app_name}/machines: {get: {tags: [Machines], summary: List Machines, description: List all Machines associated with a specific app, with optional filters for including deleted Machines and filtering by region. +, operationId: Machines_list, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: include_deleted, in: query, description: Include deleted machines, schema: {type: boolean}}, {name: region, in: query, description: Region filter, schema: {type: string}}, {name: state, in: query, description: comma separated list of states to filter (created, started, stopped, suspended), schema: {type: string}}, {name: summary, in: query, description: Only return summary info about machines (omit config, checks, events, host_status, nonce, etc.), schema: {type: boolean}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/Machine}}}}}}}, post: {tags: [Machines], summary: Create Machine, description: Create a Machine within a specific app using the details provided in the request body. + +**Important**: This request can fail, and you’re responsible for handling that failure. If you ask for a large Machine, or a Machine in a region we happen to be at capacity for, you might need to retry the request, or to fall back to another region. If you’re working directly with the Machines API, you’re taking some responsibility for your own orchestration! +, operationId: Machines_create, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], requestBody: {description: Create machine request, content: {application/json: {schema: {$ref: #/components/schemas/CreateMachineRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}}, x-codegen-request-body-name: request}}, /apps/{app_name}/machines/{machine_id}: {get: {tags: [Machines], summary: Get Machine, description: Get details of a specific Machine within an app by the Machine ID. +, operationId: Machines_show, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}}}, post: {tags: [Machines], summary: Update Machine, description: Update a Machine's configuration using the details provided in the request body. +, operationId: Machines_update, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/UpdateMachineRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Machine}}}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}, delete: {tags: [Machines], summary: Destroy Machine, description: Delete a specific Machine within an app by Machine ID, with an optional force parameter to force kill the Machine if it's running. +, operationId: Machines_delete, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: force, in: query, description: Force kill the machine if it's running, schema: {type: boolean}}], responses: {200: {description: OK, content: {}}}}}, /apps/{app_name}/machines/{machine_id}/cordon: {post: {tags: [Machines], summary: Cordon Machine, description: “Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones. +, operationId: Machines_cordon, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, /apps/{app_name}/machines/{machine_id}/events: {get: {tags: [Machines], summary: List Events, description: List all events associated with a specific Machine within an app. +, operationId: Machines_list_events, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/MachineEvent}}}}}}}}, /apps/{app_name}/machines/{machine_id}/exec: {post: {tags: [Machines], summary: Execute Command, description: Execute a command on a specific Machine and return the raw command output bytes. +, operationId: Machines_exec, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/MachineExecRequest}}}, required: true}, responses: {200: {description: stdout, stderr, exit code, and exit signal are returned, content: {application/octet-stream: {schema: {$ref: #/components/schemas/flydv1.ExecResponse}}, application/json: {schema: {$ref: #/components/schemas/flydv1.ExecResponse}}}}, 400: {description: Bad Request, content: {application/octet-stream: {schema: {$ref: #/components/schemas/ErrorResponse}}, application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, /apps/{app_name}/machines/{machine_id}/lease: {get: {tags: [Machines], summary: Get Lease, description: Retrieve the current lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, operationId: Machines_show_lease, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Lease}}}}}}, post: {tags: [Machines], summary: Create Lease, description: Create a lease for a specific Machine within an app using the details provided in the request body. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, operationId: Machines_create_lease, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: fly-machine-lease-nonce, in: header, description: Existing lease nonce to refresh by ttl, empty or non-existent to create a new lease, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateLeaseRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Lease}}}}}, x-codegen-request-body-name: request}, delete: {tags: [Machines], summary: Release Lease, description: Release the lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine. +, operationId: Machines_release_lease, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: fly-machine-lease-nonce, in: header, description: Existing lease nonce, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, /apps/{app_name}/machines/{machine_id}/metadata: {get: {tags: [Machines], summary: Get Metadata, description: Retrieve metadata for a specific Machine within an app. +, operationId: Machines_show_metadata, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: object, additionalProperties: {type: string}}}}}}}}, /apps/{app_name}/machines/{machine_id}/metadata/{key}: {post: {tags: [Machines], summary: Update Metadata, description: Update metadata for a specific machine within an app by providing a metadata key. +, operationId: Machines_update_metadata, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: key, in: path, description: Metadata Key, required: true, schema: {type: string}}], responses: {204: {description: No Content, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}, delete: {tags: [Machines], summary: Delete Metadata, description: Delete metadata for a specific Machine within an app by providing a metadata key. +, operationId: Machines_delete_metadata, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: key, in: path, description: Metadata Key, required: true, schema: {type: string}}], responses: {204: {description: No Content, content: {}}}}}, /apps/{app_name}/machines/{machine_id}/ps: {get: {tags: [Machines], summary: List Processes, description: List all processes running on a specific Machine within an app, with optional sorting parameters. +, operationId: Machines_list_processes, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: sort_by, in: query, description: Sort by, schema: {type: string}}, {name: order, in: query, description: Order, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/ProcessStat}}}}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}}, /apps/{app_name}/machines/{machine_id}/restart: {post: {tags: [Machines], summary: Restart Machine, description: Restart a specific Machine within an app, with an optional timeout parameter. +, operationId: Machines_restart, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: timeout, in: query, description: Restart timeout as a Go duration string or number of seconds, schema: {type: string}}, {name: signal, in: query, description: Unix signal name, schema: {type: string}}], responses: {200: {description: OK, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}}, /apps/{app_name}/machines/{machine_id}/signal: {post: {tags: [Machines], summary: Signal Machine, description: Send a signal to a specific Machine within an app using the details provided in the request body. +, operationId: Machines_signal, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/SignalRequest}}}, required: true}, responses: {200: {description: OK, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, /apps/{app_name}/machines/{machine_id}/start: {post: {tags: [Machines], summary: Start Machine, description: Start a specific Machine within an app. +, operationId: Machines_start, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, /apps/{app_name}/machines/{machine_id}/stop: {post: {tags: [Machines], summary: Stop Machine, description: Stop a specific Machine within an app, with an optional request body to specify signal and timeout. +, operationId: Machines_stop, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], requestBody: {description: Optional request body, content: {application/json: {schema: {$ref: #/components/schemas/StopRequest}}}, required: false}, responses: {200: {description: OK, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, /apps/{app_name}/machines/{machine_id}/suspend: {post: {tags: [Machines], summary: Suspend Machine, description: Suspend a specific Machine within an app. The next start operation will attempt (but is not guaranteed) to resume the Machine from a snapshot taken at suspension time, rather than performing a cold boot. +, operationId: Machines_suspend, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, /apps/{app_name}/machines/{machine_id}/uncordon: {post: {tags: [Machines], summary: Uncordon Machine, description: “Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones. +, operationId: Machines_uncordon, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, /apps/{app_name}/machines/{machine_id}/versions: {get: {tags: [Machines], summary: List Versions, description: List all versions of the configuration for a specific Machine within an app. +, operationId: Machines_list_versions, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/MachineVersion}}}}}}}}, /apps/{app_name}/machines/{machine_id}/wait: {get: {tags: [Machines], summary: Wait for State, description: Wait for a Machine to reach a specific state. Specify the desired state with the state parameter. See the [Machine states table](https://fly.io/docs/machines/working-with-machines/#machine-states) for a list of possible states. The default for this parameter is `started`. + +This request will block for up to 60 seconds. Set a shorter timeout with the timeout parameter. +, operationId: Machines_wait, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: machine_id, in: path, description: Machine ID, required: true, schema: {type: string}}, {name: instance_id, in: query, description: 26-character Machine version ID, schema: {type: string}}, {name: timeout, in: query, description: wait timeout. default 60s, schema: {type: integer}}, {name: state, in: query, description: desired state, schema: {type: string, enum: [started, stopped, suspended, destroyed]}}], responses: {200: {description: OK, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}}, /apps/{app_name}/secrets: {get: {tags: [Secrets], summary: List App secrets, operationId: Secrets_list, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/ListSecret}}}}}}}}, /apps/{app_name}/secrets/{secret_label}: {delete: {tags: [Secrets], summary: Destroy Secret, operationId: Secret_delete, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, /apps/{app_name}/secrets/{secret_label}/type/{secret_type}: {post: {tags: [Secrets], summary: Create Secret, operationId: Secret_create, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}, {name: secret_type, in: path, description: App Secret Type, required: true, schema: {type: string}}], requestBody: {description: secret body, content: {application/json: {schema: {$ref: #/components/schemas/CreateSecretRequest}}}, required: true}, responses: {201: {description: Created, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}, /apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate: {post: {tags: [Secrets], summary: Generate Secret, operationId: Secret_generate, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: secret_label, in: path, description: App Secret Label, required: true, schema: {type: string}}, {name: secret_type, in: path, description: App Secret Type, required: true, schema: {type: string}}], responses: {201: {description: Created, content: {}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}}}, /apps/{app_name}/volumes: {get: {tags: [Volumes], summary: List Volumes, description: List all volumes associated with a specific app. +, operationId: Volumes_list, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: summary, in: query, description: Only return summary info about volumes (omit blocks, block size, etc), schema: {type: boolean}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/Volume}}}}}}}, post: {tags: [Volumes], summary: Create Volume, description: Create a volume for a specific app using the details provided in the request body. +, operationId: Volumes_create, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateVolumeRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}}, x-codegen-request-body-name: request}}, /apps/{app_name}/volumes/{volume_id}: {get: {tags: [Volumes], summary: Get Volume, description: Retrieve details about a specific volume by its ID within an app. +, operationId: Volumes_get_by_id, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}}}, put: {tags: [Volumes], summary: Update Volume, description: Update a volume's configuration using the details provided in the request body. +, operationId: Volumes_update, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/UpdateVolumeRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}, delete: {tags: [Volumes], summary: Destroy Volume, description: Delete a specific volume within an app by volume ID. +, operationId: Volume_delete, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/Volume}}}}}}}, /apps/{app_name}/volumes/{volume_id}/extend: {put: {tags: [Volumes], summary: Extend Volume, description: Extend a volume's size within an app using the details provided in the request body. +, operationId: Volumes_extend, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], requestBody: {description: Request body, content: {application/json: {schema: {$ref: #/components/schemas/ExtendVolumeRequest}}}, required: true}, responses: {200: {description: OK, content: {application/json: {schema: {$ref: #/components/schemas/ExtendVolumeResponse}}}}}, x-codegen-request-body-name: request}}, /apps/{app_name}/volumes/{volume_id}/snapshots: {get: {tags: [Volumes], summary: List Snapshots, description: List all snapshots for a specific volume within an app. +, operationId: Volumes_list_snapshots, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {application/json: {schema: {type: array, items: {$ref: #/components/schemas/VolumeSnapshot}}}}}}}, post: {tags: [Volumes], summary: Create Snapshot, description: Create a snapshot for a specific volume within an app. +, operationId: createVolumeSnapshot, parameters: [{name: app_name, in: path, description: Fly App Name, required: true, schema: {type: string}}, {name: volume_id, in: path, description: Volume ID, required: true, schema: {type: string}}], responses: {200: {description: OK, content: {}}}}}, /tokens/kms: {post: {tags: [Tokens], summary: Request a Petsem token for accessing KMS, description: This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource., operationId: Tokens_request_Kms, responses: {200: {description: KMS token, content: {application/json: {schema: {type: string}}}}}}}, /tokens/oidc: {post: {tags: [Tokens], summary: Request an OIDC token, description: Request an Open ID Connect token for your machine. Customize the audience claim with the `aud` parameter. This returns a JWT token. Learn more about [using OpenID Connect](/docs/reference/openid-connect/) on Fly.io. +, operationId: Tokens_request_OIDC, requestBody: {description: Optional request body, content: {application/json: {schema: {$ref: #/components/schemas/CreateOIDCTokenRequest}}}, required: true}, responses: {200: {description: OIDC token, content: {application/json: {schema: {type: string}}}}, 400: {description: Bad Request, content: {application/json: {schema: {$ref: #/components/schemas/ErrorResponse}}}}}, x-codegen-request-body-name: request}}}, components: {schemas: {App: {type: object, properties: {id: {type: string}, name: {type: string}, organization: {$ref: #/components/schemas/Organization}, status: {type: string}}}, CheckStatus: {type: object, properties: {name: {type: string}, output: {type: string}, status: {type: string}, updated_at: {type: string}}}, CreateAppRequest: {type: object, properties: {app_name: {type: string}, enable_subdomains: {type: boolean}, network: {type: string}, org_slug: {type: string}}}, CreateLeaseRequest: {type: object, properties: {description: {type: string}, ttl: {type: integer, description: seconds lease will be valid}}}, CreateMachineRequest: {type: object, properties: {config: {type: object, description: An object defining the Machine configuration, allOf: [{$ref: #/components/schemas/fly.MachineConfig}]}, lease_ttl: {type: integer}, lsvd: {type: boolean}, name: {type: string, description: Unique name for this Machine. If omitted, one is generated for you}, region: {type: string, description: The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).}, skip_launch: {type: boolean}, skip_service_registration: {type: boolean}}}, CreateOIDCTokenRequest: {type: object, properties: {aud: {type: string, example: https://fly.io/org-slug}, aws_principal_tags: {type: boolean}}, description: Optional parameters}, CreateSecretRequest: {type: object, properties: {value: {type: array, items: {type: integer}}}}, CreateVolumeRequest: {type: object, properties: {compute: {$ref: #/components/schemas/fly.MachineGuest}, compute_image: {type: string}, encrypted: {type: boolean}, fstype: {type: string}, name: {type: string}, region: {type: string}, require_unique_zone: {type: boolean}, size_gb: {type: integer}, snapshot_id: {type: string, description: restore from snapshot}, snapshot_retention: {type: integer}, source_volume_id: {type: string, description: fork from remote volume}, unique_zone_app_wide: {type: boolean}}}, ErrorResponse: {type: object, properties: {details: {type: object, description: Deprecated}, error: {type: string}, status: {$ref: #/components/schemas/main.statusCode}}}, ExtendVolumeRequest: {type: object, properties: {size_gb: {type: integer}}}, ExtendVolumeResponse: {type: object, properties: {needs_restart: {type: boolean}, volume: {$ref: #/components/schemas/Volume}}}, ImageRef: {type: object, properties: {digest: {type: string}, labels: {type: object, additionalProperties: {type: string}}, registry: {type: string}, repository: {type: string}, tag: {type: string}}}, Lease: {type: object, properties: {description: {type: string, description: Description or reason for the Lease.}, expires_at: {type: integer, description: ExpiresAt is the unix timestamp in UTC to denote when the Lease will no longer be valid.}, nonce: {type: string, description: Nonce is the unique ID autogenerated and associated with the Lease.}, owner: {type: string, description: Owner is the user identifier which acquired the Lease.}, version: {type: string, description: Machine version}}}, ListApp: {type: object, properties: {id: {type: string}, machine_count: {type: integer}, name: {type: string}, network: {type: object}}}, ListAppsResponse: {type: object, properties: {apps: {type: array, items: {$ref: #/components/schemas/ListApp}}, total_apps: {type: integer}}}, ListSecret: {type: object, properties: {label: {type: string}, publickey: {type: array, items: {type: integer}}, type: {type: string}}}, ListenSocket: {type: object, properties: {address: {type: string}, proto: {type: string}}}, Machine: {type: object, properties: {checks: {type: array, items: {$ref: #/components/schemas/CheckStatus}}, config: {$ref: #/components/schemas/fly.MachineConfig}, created_at: {type: string}, events: {type: array, items: {$ref: #/components/schemas/MachineEvent}}, host_status: {type: string, enum: [ok, unknown, unreachable]}, id: {type: string}, image_ref: {$ref: #/components/schemas/ImageRef}, incomplete_config: {$ref: #/components/schemas/fly.MachineConfig}, instance_id: {type: string, description: InstanceID is unique for each version of the machine}, name: {type: string}, nonce: {type: string, description: Nonce is only every returned on machine creation if a lease_duration was provided.}, private_ip: {type: string, description: PrivateIP is the internal 6PN address of the machine.}, region: {type: string}, state: {type: string}, updated_at: {type: string}}}, MachineEvent: {type: object, properties: {id: {type: string}, request: {type: object}, source: {type: string}, status: {type: string}, timestamp: {type: integer}, type: {type: string}}}, MachineExecRequest: {type: object, properties: {cmd: {type: string, description: Deprecated: use Command instead}, command: {type: array, items: {type: string}}, container: {type: string}, stdin: {type: string}, timeout: {type: integer}}}, MachineVersion: {type: object, properties: {user_config: {$ref: #/components/schemas/fly.MachineConfig}, version: {type: string}}}, Organization: {type: object, properties: {name: {type: string}, slug: {type: string}}}, ProcessStat: {type: object, properties: {command: {type: string}, cpu: {type: integer}, directory: {type: string}, listen_sockets: {type: array, items: {$ref: #/components/schemas/ListenSocket}}, pid: {type: integer}, rss: {type: integer}, rtime: {type: integer}, stime: {type: integer}}}, SignalRequest: {type: object, properties: {signal: {type: string, enum: [SIGABRT, SIGALRM, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGTERM, SIGTRAP, SIGUSR1]}}}, StopRequest: {type: object, properties: {signal: {type: string}, timeout: {$ref: #/components/schemas/fly.Duration}}}, UpdateMachineRequest: {type: object, properties: {config: {type: object, description: An object defining the Machine configuration, allOf: [{$ref: #/components/schemas/fly.MachineConfig}]}, current_version: {type: string}, lease_ttl: {type: integer}, lsvd: {type: boolean}, name: {type: string, description: Unique name for this Machine. If omitted, one is generated for you}, region: {type: string, description: The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).}, skip_launch: {type: boolean}, skip_service_registration: {type: boolean}}}, UpdateVolumeRequest: {type: object, properties: {auto_backup_enabled: {type: boolean}, snapshot_retention: {type: integer}}}, Volume: {type: object, properties: {attached_alloc_id: {type: string}, attached_machine_id: {type: string}, auto_backup_enabled: {type: boolean}, block_size: {type: integer}, blocks: {type: integer}, blocks_avail: {type: integer}, blocks_free: {type: integer}, created_at: {type: string}, encrypted: {type: boolean}, fstype: {type: string}, host_status: {type: string, enum: [ok, unknown, unreachable]}, id: {type: string}, name: {type: string}, region: {type: string}, size_gb: {type: integer}, snapshot_retention: {type: integer}, state: {type: string}, zone: {type: string}}}, VolumeSnapshot: {type: object, properties: {created_at: {type: string}, digest: {type: string}, id: {type: string}, retention_days: {type: integer}, size: {type: integer}, status: {type: string}}}, fly.ContainerConfig: {type: object, properties: {cmd: {type: array, description: CmdOverride is used to override the default command of the image., items: {type: string}}, depends_on: {type: array, description: DependsOn can be used to define dependencies between containers. The container will only be +started after all of its dependent conditions have been satisfied., items: {$ref: #/components/schemas/fly.ContainerDependency}}, entrypoint: {type: array, description: EntrypointOverride is used to override the default entrypoint of the image., items: {type: string}}, env: {type: object, additionalProperties: {type: string}, description: ExtraEnv is used to add additional environment variables to the container.}, env_from: {type: array, description: EnvFrom can be provided to set environment variables from machine fields., items: {$ref: #/components/schemas/fly.EnvFrom}}, exec: {type: array, description: Image Config overrides - these fields are used to override the image configuration. +If not provided, the image configuration will be used. +ExecOverride is used to override the default command of the image., items: {type: string}}, files: {type: array, description: Files are files that will be written to the container file system., items: {$ref: #/components/schemas/fly.File}}, healthchecks: {type: array, description: Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command., items: {$ref: #/components/schemas/fly.ContainerHealthcheck}}, image: {type: string, description: Image is the docker image to run.}, mounts: {type: array, description: Set of mounts added to the container. These must reference a volume in the machine config via its name., items: {$ref: #/components/schemas/fly.ContainerMount}}, name: {type: string, description: Name is used to identify the container in the machine.}, restart: {type: object, description: Restart is used to define the restart policy for the container. NOTE: spot-price is not +supported for containers., allOf: [{$ref: #/components/schemas/fly.MachineRestart}]}, secrets: {type: array, description: Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., items: {$ref: #/components/schemas/fly.MachineSecret}}, stop: {type: object, description: Stop is used to define the signal and timeout for stopping the container., allOf: [{$ref: #/components/schemas/fly.StopConfig}]}, user: {type: string, description: UserOverride is used to override the default user of the image.}}}, fly.ContainerDependency: {type: object, properties: {condition: {type: object, allOf: [{$ref: #/components/schemas/fly.ContainerDependencyCondition}]}, name: {type: string}}}, fly.ContainerDependencyCondition: {type: string, enum: [exited_successfully, healthy, started], x-enum-varnames: [ExitedSuccessfully, Healthy, Started]}, fly.ContainerHealthcheck: {type: object, properties: {exec: {$ref: #/components/schemas/fly.ExecHealthcheck}, failure_threshold: {type: integer, description: The number of times the check must fail before considering the container unhealthy.}, grace_period: {type: integer, description: The time in seconds to wait after a container starts before checking its health.}, http: {$ref: #/components/schemas/fly.HTTPHealthcheck}, interval: {type: integer, description: The time in seconds between executing the defined check.}, kind: {type: object, description: Kind of healthcheck (readiness, liveness), allOf: [{$ref: #/components/schemas/fly.ContainerHealthcheckKind}]}, name: {type: string, description: The name of the check. Must be unique within the container.}, success_threshold: {type: integer, description: The number of times the check must succeeed before considering the container healthy.}, tcp: {$ref: #/components/schemas/fly.TCPHealthcheck}, timeout: {type: integer, description: The time in seconds to wait for the check to complete.}, unhealthy: {type: object, description: Unhealthy policy that determines what action to take if a container is deemed unhealthy, allOf: [{$ref: #/components/schemas/fly.UnhealthyPolicy}]}}}, fly.ContainerHealthcheckKind: {type: string, enum: [readiness, liveness], x-enum-varnames: [Readiness, Liveness]}, fly.ContainerHealthcheckScheme: {type: string, enum: [http, https], x-enum-varnames: [HTTP, HTTPS]}, fly.ContainerMount: {type: object, properties: {name: {type: string, description: The name of the volume. Must exist in the volumes field in the machine configuration}, path: {type: string, description: The path to mount the volume within the container}}}, fly.DNSConfig: {type: object, properties: {dns_forward_rules: {type: array, items: {$ref: #/components/schemas/fly.dnsForwardRule}}, hostname: {type: string}, hostname_fqdn: {type: string}, nameservers: {type: array, items: {type: string}}, options: {type: array, items: {$ref: #/components/schemas/fly.dnsOption}}, searches: {type: array, items: {type: string}}, skip_registration: {type: boolean}}}, fly.Duration: {type: object, properties: {time.Duration: {type: integer, x-enum-varnames: [minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, minDuration, maxDuration, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour]}}}, fly.EnvFrom: {type: object, properties: {env_var: {type: string, description: EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name.}, field_ref: {type: string, description: FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image., enum: [id, version, app_name, private_ip, region, image]}}, description: EnvVar defines an environment variable to be populated from a machine field, env_var}, fly.ExecHealthcheck: {type: object, properties: {command: {type: array, description: The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"]), items: {type: string}}}}, fly.File: {type: object, properties: {guest_path: {type: string, description: GuestPath is the path on the machine where the file will be written and must be an absolute path. +For example: /full/path/to/file.json}, mode: {type: integer, description: Mode bits used to set permissions on this file as accepted by chmod(2).}, raw_value: {type: string, description: The base64 encoded string of the file contents.}, secret_name: {type: string, description: The name of the secret that contains the base64 encoded file contents.}}, description: A file that will be written to the Machine. One of RawValue or SecretName must be set.}, fly.HTTPHealthcheck: {type: object, properties: {headers: {type: array, description: Additional headers to send with the request, items: {$ref: #/components/schemas/fly.MachineHTTPHeader}}, method: {type: string, description: The HTTP method to use to when making the request}, path: {type: string, description: The path to send the request to}, port: {type: integer, description: The port to connect to, often the same as internal_port}, scheme: {type: object, description: Whether to use http or https, allOf: [{$ref: #/components/schemas/fly.ContainerHealthcheckScheme}]}, tls_server_name: {type: string, description: If the protocol is https, the hostname to use for TLS certificate validation}, tls_skip_verify: {type: boolean, description: If the protocol is https, whether or not to verify the TLS certificate}}}, fly.HTTPOptions: {type: object, properties: {compress: {type: boolean}, h2_backend: {type: boolean}, headers_read_timeout: {type: integer}, idle_timeout: {type: integer}, response: {$ref: #/components/schemas/fly.HTTPResponseOptions}}}, fly.HTTPResponseOptions: {type: object, properties: {headers: {type: object, additionalProperties: {type: object}}, pristine: {type: boolean}}}, fly.MachineCheck: {type: object, properties: {grace_period: {type: object, description: The time to wait after a VM starts before checking its health, allOf: [{$ref: #/components/schemas/fly.Duration}]}, headers: {type: array, items: {$ref: #/components/schemas/fly.MachineHTTPHeader}}, interval: {type: object, description: The time between connectivity checks, allOf: [{$ref: #/components/schemas/fly.Duration}]}, kind: {type: string, description: Kind of the check (informational, readiness), enum: [informational, readiness]}, method: {type: string, description: For http checks, the HTTP method to use to when making the request}, path: {type: string, description: For http checks, the path to send the request to}, port: {type: integer, description: The port to connect to, often the same as internal_port}, protocol: {type: string, description: For http checks, whether to use http or https}, timeout: {type: object, description: The maximum time a connection can take before being reported as failing its health check, allOf: [{$ref: #/components/schemas/fly.Duration}]}, tls_server_name: {type: string, description: If the protocol is https, the hostname to use for TLS certificate validation}, tls_skip_verify: {type: boolean, description: For http checks with https protocol, whether or not to verify the TLS certificate}, type: {type: string, description: tcp or http}}, description: An optional object that defines one or more named checks. The key for each check is the check name.}, fly.MachineConfig: {type: object, properties: {auto_destroy: {type: boolean, description: Optional boolean telling the Machine to destroy itself once it’s complete (default false)}, checks: {type: object, additionalProperties: {$ref: #/components/schemas/fly.MachineCheck}}, containers: {type: array, description: Containers are a list of containers that will run in the machine. Currently restricted to +only specific organizations., items: {$ref: #/components/schemas/fly.ContainerConfig}}, disable_machine_autostart: {type: boolean, description: Deprecated: use Service.Autostart instead}, dns: {$ref: #/components/schemas/fly.DNSConfig}, env: {type: object, additionalProperties: {type: string}, description: An object filled with key/value pairs to be set as environment variables}, files: {type: array, items: {$ref: #/components/schemas/fly.File}}, guest: {$ref: #/components/schemas/fly.MachineGuest}, image: {type: string, description: The docker image to run}, init: {$ref: #/components/schemas/fly.MachineInit}, metadata: {type: object, additionalProperties: {type: string}}, metrics: {$ref: #/components/schemas/fly.MachineMetrics}, mounts: {type: array, items: {$ref: #/components/schemas/fly.MachineMount}}, processes: {type: array, items: {$ref: #/components/schemas/fly.MachineProcess}}, restart: {$ref: #/components/schemas/fly.MachineRestart}, schedule: {type: string}, services: {type: array, items: {$ref: #/components/schemas/fly.MachineService}}, size: {type: string, description: Deprecated: use Guest instead}, standbys: {type: array, description: Standbys enable a machine to be a standby for another. In the event of a hardware failure, +the standby machine will be started., items: {type: string}}, statics: {type: array, items: {$ref: #/components/schemas/fly.Static}}, stop_config: {$ref: #/components/schemas/fly.StopConfig}, volumes: {type: array, description: Volumes describe the set of volumes that can be attached to the machine. Used in conjuction +with containers, items: {$ref: #/components/schemas/fly.VolumeConfig}}}}, fly.MachineGuest: {type: object, properties: {cpu_kind: {type: string}, cpus: {type: integer}, gpu_kind: {type: string}, gpus: {type: integer}, host_dedication_id: {type: string}, kernel_args: {type: array, items: {type: string}}, memory_mb: {type: integer}}}, fly.MachineHTTPHeader: {type: object, properties: {name: {type: string, description: The header name}, values: {type: array, description: The header value, items: {type: string}}}, description: For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call.}, fly.MachineInit: {type: object, properties: {cmd: {type: array, items: {type: string}}, entrypoint: {type: array, items: {type: string}}, exec: {type: array, items: {type: string}}, kernel_args: {type: array, items: {type: string}}, swap_size_mb: {type: integer}, tty: {type: boolean}}}, fly.MachineMetrics: {type: object, properties: {https: {type: boolean}, path: {type: string}, port: {type: integer}}}, fly.MachineMount: {type: object, properties: {add_size_gb: {type: integer}, encrypted: {type: boolean}, extend_threshold_percent: {type: integer}, name: {type: string}, path: {type: string}, size_gb: {type: integer}, size_gb_limit: {type: integer}, volume: {type: string}}}, fly.MachinePort: {type: object, properties: {end_port: {type: integer}, force_https: {type: boolean}, handlers: {type: array, items: {type: string}}, http_options: {$ref: #/components/schemas/fly.HTTPOptions}, port: {type: integer}, proxy_proto_options: {$ref: #/components/schemas/fly.ProxyProtoOptions}, start_port: {type: integer}, tls_options: {$ref: #/components/schemas/fly.TLSOptions}}}, fly.MachineProcess: {type: object, properties: {cmd: {type: array, items: {type: string}}, entrypoint: {type: array, items: {type: string}}, env: {type: object, additionalProperties: {type: string}}, env_from: {type: array, description: EnvFrom can be provided to set environment variables from machine fields., items: {$ref: #/components/schemas/fly.EnvFrom}}, exec: {type: array, items: {type: string}}, ignore_app_secrets: {type: boolean, description: IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to +and only use the secrets provided at the process level. The default/legacy behavior is to use +the secrets provided at the App level.}, secrets: {type: array, description: Secrets can be provided at the process level to explicitly indicate which secrets should be +used for the process. If not provided, the secrets provided at the machine level will be used., items: {$ref: #/components/schemas/fly.MachineSecret}}, user: {type: string}}}, fly.MachineRestart: {type: object, properties: {gpu_bid_price: {type: number, description: GPU bid price for spot Machines.}, max_retries: {type: integer, description: When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.}, policy: {type: string, description: * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. +* always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. +* on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. +* spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price., enum: [no, always, on-failure, spot-price]}}, description: The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.}, fly.MachineSecret: {type: object, properties: {env_var: {type: string, description: EnvVar is required and is the name of the environment variable that will be set from the +secret. It must be a valid environment variable name.}, name: {type: string, description: Name is optional and when provided is used to reference a secret name where the EnvVar is +different from what was set as the secret name.}}, description: A Secret needing to be set in the environment of the Machine. env_var is required}, fly.MachineService: {type: object, properties: {autostart: {type: boolean}, autostop: {type: string, description: Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. +* "off" or false - Do not autostop the Machine. +* "stop" or true - Automatically stop the Machine. +* "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible., enum: [off, stop, suspend]}, checks: {type: array, items: {$ref: #/components/schemas/fly.MachineCheck}}, concurrency: {$ref: #/components/schemas/fly.MachineServiceConcurrency}, force_instance_description: {type: string}, force_instance_key: {type: string}, internal_port: {type: integer}, min_machines_running: {type: integer}, ports: {type: array, items: {$ref: #/components/schemas/fly.MachinePort}}, protocol: {type: string}}}, fly.MachineServiceConcurrency: {type: object, properties: {hard_limit: {type: integer}, soft_limit: {type: integer}, type: {type: string}}}, fly.ProxyProtoOptions: {type: object, properties: {version: {type: string}}}, fly.Static: {required: [guest_path, url_prefix], type: object, properties: {guest_path: {type: string}, index_document: {type: string}, tigris_bucket: {type: string}, url_prefix: {type: string}}}, fly.StopConfig: {type: object, properties: {signal: {type: string}, timeout: {$ref: #/components/schemas/fly.Duration}}}, fly.TCPHealthcheck: {type: object, properties: {port: {type: integer, description: The port to connect to, often the same as internal_port}}}, fly.TLSOptions: {type: object, properties: {alpn: {type: array, items: {type: string}}, default_self_signed: {type: boolean}, versions: {type: array, items: {type: string}}}}, fly.TempDirVolume: {type: object, properties: {size_mb: {type: integer, description: The size limit of the temp dir, only applicable when using disk backed storage.}, storage_type: {type: string, description: The type of storage used to back the temp dir. Either disk or memory.}}}, fly.UnhealthyPolicy: {type: string, enum: [stop], x-enum-varnames: [UnhealthyPolicyStop]}, fly.VolumeConfig: {type: object, properties: {name: {type: string, description: The name of the volume. A volume must have a unique name within an app}, temp_dir: {$ref: #/components/schemas/fly.TempDirVolume}}}, fly.dnsForwardRule: {type: object, properties: {addr: {type: string}, basename: {type: string}}}, fly.dnsOption: {type: object, properties: {name: {type: string}, value: {type: string}}}, flydv1.ExecResponse: {type: object, properties: {exit_code: {type: integer}, exit_signal: {type: integer}, stderr: {type: string}, stdout: {type: string}}}, main.statusCode: {type: string, enum: [unknown, insufficient_capacity], x-enum-varnames: [unknown, capacityErr]}}}, x-original-swagger-version: 2.0}, + extensions={x-original-swagger-version: 2.0}, +} \ No newline at end of file diff --git a/apps/cli/test/openapi/fixtures/fly_api.yaml b/apps/cli/test/openapi/fixtures/fly_api.yaml new file mode 100644 index 000000000..2791424c0 --- /dev/null +++ b/apps/cli/test/openapi/fixtures/fly_api.yaml @@ -0,0 +1,2709 @@ +openapi: '3.0.1' +info: + title: Machines API + description: |- + This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/) for how to get started, more information about each endpoint, parameter descriptions, and examples. + version: '1.0' + contact: {} + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: https://api.machines.dev/v1 +paths: + '/apps': + get: + tags: + - Apps + summary: List Apps + description: "List all apps with the ability to filter by organization slug.\n" + operationId: Apps_list + parameters: + - name: org_slug + in: query + required: true + description: |- + The org slug, or 'personal', to filter apps + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListAppsResponse' + post: + tags: + - Apps + summary: Create App + description: "Create an app with the specified details in the request body.\n" + operationId: Apps_create + requestBody: + description: |- + App body + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppRequest' + required: true + responses: + '201': + description: |- + Created + content: {} + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-codegen-request-body-name: request + '/apps/{app_name}': + get: + tags: + - Apps + summary: Get App + description: "Retrieve details about a specific app by its name.\n" + operationId: Apps_show + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/App' + delete: + tags: + - Apps + summary: Destroy App + description: "Delete an app by its name.\n" + operationId: Apps_delete + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + responses: + '202': + description: |- + Accepted + content: {} + '/apps/{app_name}/machines': + get: + tags: + - Machines + summary: List Machines + description: "List all Machines associated with a specific app, with optional filters for including deleted Machines and filtering by region.\n" + operationId: Machines_list + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: include_deleted + in: query + description: |- + Include deleted machines + schema: + type: boolean + - name: region + in: query + description: |- + Region filter + schema: + type: string + - name: state + in: query + description: |- + comma separated list of states to filter (created, started, stopped, suspended) + schema: + type: string + - name: summary + in: query + description: |- + Only return summary info about machines (omit config, checks, events, host_status, nonce, etc.) + schema: + type: boolean + responses: + '200': + description: |- + OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Machine' + post: + tags: + - Machines + summary: Create Machine + description: "Create a Machine within a specific app using the details provided in the request body.\n\n**Important**: This request can fail, and you’re responsible for handling that failure. If you ask for a large Machine, or a Machine in a region we happen to be at capacity for, you might need to retry the request, or to fall back to another region. If you’re working directly with the Machines API, you’re taking some responsibility for your own orchestration!\n" + operationId: Machines_create + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + requestBody: + description: |- + Create machine request + content: + application/json: + schema: + $ref: '#/components/schemas/CreateMachineRequest' + required: true + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Machine' + x-codegen-request-body-name: request + '/apps/{app_name}/machines/{machine_id}': + get: + tags: + - Machines + summary: Get Machine + description: "Get details of a specific Machine within an app by the Machine ID.\n" + operationId: Machines_show + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Machine' + post: + tags: + - Machines + summary: Update Machine + description: "Update a Machine's configuration using the details provided in the request body.\n" + operationId: Machines_update + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + requestBody: + description: |- + Request body + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMachineRequest' + required: true + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Machine' + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-codegen-request-body-name: request + delete: + tags: + - Machines + summary: Destroy Machine + description: "Delete a specific Machine within an app by Machine ID, with an optional force parameter to force kill the Machine if it's running.\n" + operationId: Machines_delete + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + - name: force + in: query + description: |- + Force kill the machine if it's running + schema: + type: boolean + responses: + '200': + description: |- + OK + content: {} + '/apps/{app_name}/machines/{machine_id}/cordon': + post: + tags: + - Machines + summary: Cordon Machine + description: "“Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue\/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones.\n" + operationId: Machines_cordon + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: {} + '/apps/{app_name}/machines/{machine_id}/events': + get: + tags: + - Machines + summary: List Events + description: "List all events associated with a specific Machine within an app.\n" + operationId: Machines_list_events + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MachineEvent' + '/apps/{app_name}/machines/{machine_id}/exec': + post: + tags: + - Machines + summary: Execute Command + description: "Execute a command on a specific Machine and return the raw command output bytes.\n" + operationId: Machines_exec + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + requestBody: + description: |- + Request body + content: + application/json: + schema: + $ref: '#/components/schemas/MachineExecRequest' + required: true + responses: + '200': + description: |- + stdout, stderr, exit code, and exit signal are returned + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/flydv1.ExecResponse' + application/json: + schema: + $ref: '#/components/schemas/flydv1.ExecResponse' + '400': + description: |- + Bad Request + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/ErrorResponse' + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-codegen-request-body-name: request + '/apps/{app_name}/machines/{machine_id}/lease': + get: + tags: + - Machines + summary: Get Lease + description: "Retrieve the current lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine.\n" + operationId: Machines_show_lease + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Lease' + post: + tags: + - Machines + summary: Create Lease + description: "Create a lease for a specific Machine within an app using the details provided in the request body. Machine leases can be used to obtain an exclusive lock on modifying a Machine.\n" + operationId: Machines_create_lease + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + - name: fly-machine-lease-nonce + in: header + description: |- + Existing lease nonce to refresh by ttl, empty or non-existent to create a new lease + schema: + type: string + requestBody: + description: |- + Request body + content: + application/json: + schema: + $ref: '#/components/schemas/CreateLeaseRequest' + required: true + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Lease' + x-codegen-request-body-name: request + delete: + tags: + - Machines + summary: Release Lease + description: "Release the lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine.\n" + operationId: Machines_release_lease + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + - name: fly-machine-lease-nonce + in: header + required: true + description: |- + Existing lease nonce + schema: + type: string + responses: + '200': + description: |- + OK + content: {} + '/apps/{app_name}/machines/{machine_id}/metadata': + get: + tags: + - Machines + summary: Get Metadata + description: "Retrieve metadata for a specific Machine within an app.\n" + operationId: Machines_show_metadata + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + type: object + additionalProperties: + type: string + '/apps/{app_name}/machines/{machine_id}/metadata/{key}': + post: + tags: + - Machines + summary: Update Metadata + description: "Update metadata for a specific machine within an app by providing a metadata key.\n" + operationId: Machines_update_metadata + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + - name: key + in: path + required: true + description: |- + Metadata Key + schema: + type: string + responses: + '204': + description: |- + No Content + content: {} + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + delete: + tags: + - Machines + summary: Delete Metadata + description: "Delete metadata for a specific Machine within an app by providing a metadata key.\n" + operationId: Machines_delete_metadata + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + - name: key + in: path + required: true + description: |- + Metadata Key + schema: + type: string + responses: + '204': + description: |- + No Content + content: {} + '/apps/{app_name}/machines/{machine_id}/ps': + get: + tags: + - Machines + summary: List Processes + description: "List all processes running on a specific Machine within an app, with optional sorting parameters.\n" + operationId: Machines_list_processes + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + - name: sort_by + in: query + description: |- + Sort by + schema: + type: string + - name: order + in: query + description: |- + Order + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProcessStat' + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '/apps/{app_name}/machines/{machine_id}/restart': + post: + tags: + - Machines + summary: Restart Machine + description: "Restart a specific Machine within an app, with an optional timeout parameter.\n" + operationId: Machines_restart + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + - name: timeout + in: query + description: |- + Restart timeout as a Go duration string or number of seconds + schema: + type: string + - name: signal + in: query + description: |- + Unix signal name + schema: + type: string + responses: + '200': + description: |- + OK + content: {} + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '/apps/{app_name}/machines/{machine_id}/signal': + post: + tags: + - Machines + summary: Signal Machine + description: "Send a signal to a specific Machine within an app using the details provided in the request body.\n" + operationId: Machines_signal + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + requestBody: + description: |- + Request body + content: + application/json: + schema: + $ref: '#/components/schemas/SignalRequest' + required: true + responses: + '200': + description: |- + OK + content: {} + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-codegen-request-body-name: request + '/apps/{app_name}/machines/{machine_id}/start': + post: + tags: + - Machines + summary: Start Machine + description: "Start a specific Machine within an app.\n" + operationId: Machines_start + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: {} + '/apps/{app_name}/machines/{machine_id}/stop': + post: + tags: + - Machines + summary: Stop Machine + description: "Stop a specific Machine within an app, with an optional request body to specify signal and timeout.\n" + operationId: Machines_stop + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + requestBody: + description: |- + Optional request body + content: + application/json: + schema: + $ref: '#/components/schemas/StopRequest' + required: false + responses: + '200': + description: |- + OK + content: {} + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-codegen-request-body-name: request + '/apps/{app_name}/machines/{machine_id}/suspend': + post: + tags: + - Machines + summary: Suspend Machine + description: "Suspend a specific Machine within an app. The next start operation will attempt (but is not guaranteed) to resume the Machine from a snapshot taken at suspension time, rather than performing a cold boot.\n" + operationId: Machines_suspend + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: {} + '/apps/{app_name}/machines/{machine_id}/uncordon': + post: + tags: + - Machines + summary: Uncordon Machine + description: "“Cordoning” a Machine refers to disabling its services, so the Fly Proxy won’t route requests to it. In flyctl this is used by blue\/green deployments; one set of Machines is started up with services disabled, and when they are all healthy, the services are enabled on the new Machines and disabled on the old ones.\n" + operationId: Machines_uncordon + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: {} + '/apps/{app_name}/machines/{machine_id}/versions': + get: + tags: + - Machines + summary: List Versions + description: "List all versions of the configuration for a specific Machine within an app.\n" + operationId: Machines_list_versions + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MachineVersion' + '/apps/{app_name}/machines/{machine_id}/wait': + get: + tags: + - Machines + summary: Wait for State + description: "Wait for a Machine to reach a specific state. Specify the desired state with the state parameter. See the [Machine states table](https:\/\/fly.io\/docs\/machines\/working-with-machines\/#machine-states) for a list of possible states. The default for this parameter is `started`.\n\nThis request will block for up to 60 seconds. Set a shorter timeout with the timeout parameter.\n" + operationId: Machines_wait + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: machine_id + in: path + required: true + description: |- + Machine ID + schema: + type: string + - name: instance_id + in: query + description: |- + 26-character Machine version ID + schema: + type: string + - name: timeout + in: query + description: |- + wait timeout. default 60s + schema: + type: integer + - name: state + in: query + description: |- + desired state + schema: + type: string + enum: + - started + - stopped + - suspended + - destroyed + responses: + '200': + description: |- + OK + content: {} + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '/apps/{app_name}/secrets': + get: + tags: + - Secrets + summary: List App secrets + operationId: Secrets_list + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ListSecret' + '/apps/{app_name}/secrets/{secret_label}': + delete: + tags: + - Secrets + summary: Destroy Secret + operationId: Secret_delete + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: secret_label + in: path + required: true + description: |- + App Secret Label + schema: + type: string + responses: + '200': + description: |- + OK + content: {} + '/apps/{app_name}/secrets/{secret_label}/type/{secret_type}': + post: + tags: + - Secrets + summary: Create Secret + operationId: Secret_create + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: secret_label + in: path + required: true + description: |- + App Secret Label + schema: + type: string + - name: secret_type + in: path + required: true + description: |- + App Secret Type + schema: + type: string + requestBody: + description: |- + secret body + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSecretRequest' + required: true + responses: + '201': + description: |- + Created + content: {} + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-codegen-request-body-name: request + '/apps/{app_name}/secrets/{secret_label}/type/{secret_type}/generate': + post: + tags: + - Secrets + summary: Generate Secret + operationId: Secret_generate + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: secret_label + in: path + required: true + description: |- + App Secret Label + schema: + type: string + - name: secret_type + in: path + required: true + description: |- + App Secret Type + schema: + type: string + responses: + '201': + description: |- + Created + content: {} + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '/apps/{app_name}/volumes': + get: + tags: + - Volumes + summary: List Volumes + description: "List all volumes associated with a specific app.\n" + operationId: Volumes_list + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: summary + in: query + description: |- + Only return summary info about volumes (omit blocks, block size, etc) + schema: + type: boolean + responses: + '200': + description: |- + OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Volume' + post: + tags: + - Volumes + summary: Create Volume + description: "Create a volume for a specific app using the details provided in the request body.\n" + operationId: Volumes_create + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + requestBody: + description: |- + Request body + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVolumeRequest' + required: true + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Volume' + x-codegen-request-body-name: request + '/apps/{app_name}/volumes/{volume_id}': + get: + tags: + - Volumes + summary: Get Volume + description: "Retrieve details about a specific volume by its ID within an app.\n" + operationId: Volumes_get_by_id + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: volume_id + in: path + required: true + description: |- + Volume ID + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Volume' + put: + tags: + - Volumes + summary: Update Volume + description: "Update a volume's configuration using the details provided in the request body.\n" + operationId: Volumes_update + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: volume_id + in: path + required: true + description: |- + Volume ID + schema: + type: string + requestBody: + description: |- + Request body + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateVolumeRequest' + required: true + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Volume' + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-codegen-request-body-name: request + delete: + tags: + - Volumes + summary: Destroy Volume + description: "Delete a specific volume within an app by volume ID.\n" + operationId: Volume_delete + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: volume_id + in: path + required: true + description: |- + Volume ID + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/Volume' + '/apps/{app_name}/volumes/{volume_id}/extend': + put: + tags: + - Volumes + summary: Extend Volume + description: "Extend a volume's size within an app using the details provided in the request body.\n" + operationId: Volumes_extend + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: volume_id + in: path + required: true + description: |- + Volume ID + schema: + type: string + requestBody: + description: |- + Request body + content: + application/json: + schema: + $ref: '#/components/schemas/ExtendVolumeRequest' + required: true + responses: + '200': + description: |- + OK + content: + application/json: + schema: + $ref: '#/components/schemas/ExtendVolumeResponse' + x-codegen-request-body-name: request + '/apps/{app_name}/volumes/{volume_id}/snapshots': + get: + tags: + - Volumes + summary: List Snapshots + description: "List all snapshots for a specific volume within an app.\n" + operationId: Volumes_list_snapshots + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: volume_id + in: path + required: true + description: |- + Volume ID + schema: + type: string + responses: + '200': + description: |- + OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VolumeSnapshot' + post: + tags: + - Volumes + summary: Create Snapshot + description: "Create a snapshot for a specific volume within an app.\n" + operationId: createVolumeSnapshot + parameters: + - name: app_name + in: path + required: true + description: |- + Fly App Name + schema: + type: string + - name: volume_id + in: path + required: true + description: |- + Volume ID + schema: + type: string + responses: + '200': + description: |- + OK + content: {} + '/tokens/kms': + post: + tags: + - Tokens + summary: Request a Petsem token for accessing KMS + description: |- + This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https://fly.io/docs/machines/api/apps-resource/) for details about using the Apps resource. + operationId: Tokens_request_Kms + responses: + '200': + description: |- + KMS token + content: + application/json: + schema: + type: string + '/tokens/oidc': + post: + tags: + - Tokens + summary: Request an OIDC token + description: "Request an Open ID Connect token for your machine. Customize the audience claim with the `aud` parameter. This returns a JWT token. Learn more about [using OpenID Connect](\/docs\/reference\/openid-connect\/) on Fly.io.\n" + operationId: Tokens_request_OIDC + requestBody: + description: |- + Optional request body + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOIDCTokenRequest' + required: true + responses: + '200': + description: |- + OIDC token + content: + application/json: + schema: + type: string + '400': + description: |- + Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + x-codegen-request-body-name: request +components: + schemas: + App: + type: object + properties: + id: + type: string + name: + type: string + organization: + $ref: '#/components/schemas/Organization' + status: + type: string + CheckStatus: + type: object + properties: + name: + type: string + output: + type: string + status: + type: string + updated_at: + type: string + CreateAppRequest: + type: object + properties: + app_name: + type: string + enable_subdomains: + type: boolean + network: + type: string + org_slug: + type: string + CreateLeaseRequest: + type: object + properties: + description: + type: string + ttl: + description: |- + seconds lease will be valid + type: integer + CreateMachineRequest: + type: object + properties: + config: + description: |- + An object defining the Machine configuration + type: object + allOf: + - $ref: '#/components/schemas/fly.MachineConfig' + lease_ttl: + type: integer + lsvd: + type: boolean + name: + description: |- + Unique name for this Machine. If omitted, one is generated for you + type: string + region: + description: |- + The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you). + type: string + skip_launch: + type: boolean + skip_service_registration: + type: boolean + CreateOIDCTokenRequest: + description: |- + Optional parameters + type: object + properties: + aud: + type: string + example: https://fly.io/org-slug + aws_principal_tags: + type: boolean + CreateSecretRequest: + type: object + properties: + value: + type: array + items: + type: integer + CreateVolumeRequest: + type: object + properties: + compute: + $ref: '#/components/schemas/fly.MachineGuest' + compute_image: + type: string + encrypted: + type: boolean + fstype: + type: string + name: + type: string + region: + type: string + require_unique_zone: + type: boolean + size_gb: + type: integer + snapshot_id: + description: |- + restore from snapshot + type: string + snapshot_retention: + type: integer + source_volume_id: + description: |- + fork from remote volume + type: string + unique_zone_app_wide: + type: boolean + ErrorResponse: + type: object + properties: + details: + description: |- + Deprecated + type: object + error: + type: string + status: + $ref: '#/components/schemas/main.statusCode' + ExtendVolumeRequest: + type: object + properties: + size_gb: + type: integer + ExtendVolumeResponse: + type: object + properties: + needs_restart: + type: boolean + volume: + $ref: '#/components/schemas/Volume' + ImageRef: + type: object + properties: + digest: + type: string + labels: + type: object + additionalProperties: + type: string + registry: + type: string + repository: + type: string + tag: + type: string + Lease: + type: object + properties: + description: + description: |- + Description or reason for the Lease. + type: string + expires_at: + description: |- + ExpiresAt is the unix timestamp in UTC to denote when the Lease will no longer be valid. + type: integer + nonce: + description: |- + Nonce is the unique ID autogenerated and associated with the Lease. + type: string + owner: + description: |- + Owner is the user identifier which acquired the Lease. + type: string + version: + description: |- + Machine version + type: string + ListApp: + type: object + properties: + id: + type: string + machine_count: + type: integer + name: + type: string + network: + type: object + ListAppsResponse: + type: object + properties: + apps: + type: array + items: + $ref: '#/components/schemas/ListApp' + total_apps: + type: integer + ListSecret: + type: object + properties: + label: + type: string + publickey: + type: array + items: + type: integer + type: + type: string + ListenSocket: + type: object + properties: + address: + type: string + proto: + type: string + Machine: + type: object + properties: + checks: + type: array + items: + $ref: '#/components/schemas/CheckStatus' + config: + $ref: '#/components/schemas/fly.MachineConfig' + created_at: + type: string + events: + type: array + items: + $ref: '#/components/schemas/MachineEvent' + host_status: + type: string + enum: + - ok + - unknown + - unreachable + id: + type: string + image_ref: + $ref: '#/components/schemas/ImageRef' + incomplete_config: + $ref: '#/components/schemas/fly.MachineConfig' + instance_id: + description: |- + InstanceID is unique for each version of the machine + type: string + name: + type: string + nonce: + description: |- + Nonce is only every returned on machine creation if a lease_duration was provided. + type: string + private_ip: + description: |- + PrivateIP is the internal 6PN address of the machine. + type: string + region: + type: string + state: + type: string + updated_at: + type: string + MachineEvent: + type: object + properties: + id: + type: string + request: + type: object + source: + type: string + status: + type: string + timestamp: + type: integer + type: + type: string + MachineExecRequest: + type: object + properties: + cmd: + description: |- + Deprecated: use Command instead + type: string + command: + type: array + items: + type: string + container: + type: string + stdin: + type: string + timeout: + type: integer + MachineVersion: + type: object + properties: + user_config: + $ref: '#/components/schemas/fly.MachineConfig' + version: + type: string + Organization: + type: object + properties: + name: + type: string + slug: + type: string + ProcessStat: + type: object + properties: + command: + type: string + cpu: + type: integer + directory: + type: string + listen_sockets: + type: array + items: + $ref: '#/components/schemas/ListenSocket' + pid: + type: integer + rss: + type: integer + rtime: + type: integer + stime: + type: integer + SignalRequest: + type: object + properties: + signal: + type: string + enum: + - SIGABRT + - SIGALRM + - SIGFPE + - SIGHUP + - SIGILL + - SIGINT + - SIGKILL + - SIGPIPE + - SIGQUIT + - SIGSEGV + - SIGTERM + - SIGTRAP + - SIGUSR1 + StopRequest: + type: object + properties: + signal: + type: string + timeout: + $ref: '#/components/schemas/fly.Duration' + UpdateMachineRequest: + type: object + properties: + config: + description: |- + An object defining the Machine configuration + type: object + allOf: + - $ref: '#/components/schemas/fly.MachineConfig' + current_version: + type: string + lease_ttl: + type: integer + lsvd: + type: boolean + name: + description: |- + Unique name for this Machine. If omitted, one is generated for you + type: string + region: + description: |- + The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you). + type: string + skip_launch: + type: boolean + skip_service_registration: + type: boolean + UpdateVolumeRequest: + type: object + properties: + auto_backup_enabled: + type: boolean + snapshot_retention: + type: integer + Volume: + type: object + properties: + attached_alloc_id: + type: string + attached_machine_id: + type: string + auto_backup_enabled: + type: boolean + block_size: + type: integer + blocks: + type: integer + blocks_avail: + type: integer + blocks_free: + type: integer + created_at: + type: string + encrypted: + type: boolean + fstype: + type: string + host_status: + type: string + enum: + - ok + - unknown + - unreachable + id: + type: string + name: + type: string + region: + type: string + size_gb: + type: integer + snapshot_retention: + type: integer + state: + type: string + zone: + type: string + VolumeSnapshot: + type: object + properties: + created_at: + type: string + digest: + type: string + id: + type: string + retention_days: + type: integer + size: + type: integer + status: + type: string + fly.ContainerConfig: + type: object + properties: + cmd: + description: |- + CmdOverride is used to override the default command of the image. + type: array + items: + type: string + depends_on: + description: |- + DependsOn can be used to define dependencies between containers. The container will only be + started after all of its dependent conditions have been satisfied. + type: array + items: + $ref: '#/components/schemas/fly.ContainerDependency' + entrypoint: + description: |- + EntrypointOverride is used to override the default entrypoint of the image. + type: array + items: + type: string + env: + description: |- + ExtraEnv is used to add additional environment variables to the container. + type: object + additionalProperties: + type: string + env_from: + description: |- + EnvFrom can be provided to set environment variables from machine fields. + type: array + items: + $ref: '#/components/schemas/fly.EnvFrom' + exec: + description: |- + Image Config overrides - these fields are used to override the image configuration. + If not provided, the image configuration will be used. + ExecOverride is used to override the default command of the image. + type: array + items: + type: string + files: + description: |- + Files are files that will be written to the container file system. + type: array + items: + $ref: '#/components/schemas/fly.File' + healthchecks: + description: |- + Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command. + type: array + items: + $ref: '#/components/schemas/fly.ContainerHealthcheck' + image: + description: |- + Image is the docker image to run. + type: string + mounts: + description: |- + Set of mounts added to the container. These must reference a volume in the machine config via its name. + type: array + items: + $ref: '#/components/schemas/fly.ContainerMount' + name: + description: |- + Name is used to identify the container in the machine. + type: string + restart: + description: |- + Restart is used to define the restart policy for the container. NOTE: spot-price is not + supported for containers. + type: object + allOf: + - $ref: '#/components/schemas/fly.MachineRestart' + secrets: + description: |- + Secrets can be provided at the process level to explicitly indicate which secrets should be + used for the process. If not provided, the secrets provided at the machine level will be used. + type: array + items: + $ref: '#/components/schemas/fly.MachineSecret' + stop: + description: |- + Stop is used to define the signal and timeout for stopping the container. + type: object + allOf: + - $ref: '#/components/schemas/fly.StopConfig' + user: + description: |- + UserOverride is used to override the default user of the image. + type: string + fly.ContainerDependency: + type: object + properties: + condition: + type: object + allOf: + - $ref: '#/components/schemas/fly.ContainerDependencyCondition' + name: + type: string + fly.ContainerDependencyCondition: + type: string + enum: + - exited_successfully + - healthy + - started + x-enum-varnames: + - ExitedSuccessfully + - Healthy + - Started + fly.ContainerHealthcheck: + type: object + properties: + exec: + $ref: '#/components/schemas/fly.ExecHealthcheck' + failure_threshold: + description: |- + The number of times the check must fail before considering the container unhealthy. + type: integer + grace_period: + description: |- + The time in seconds to wait after a container starts before checking its health. + type: integer + http: + $ref: '#/components/schemas/fly.HTTPHealthcheck' + interval: + description: |- + The time in seconds between executing the defined check. + type: integer + kind: + description: |- + Kind of healthcheck (readiness, liveness) + type: object + allOf: + - $ref: '#/components/schemas/fly.ContainerHealthcheckKind' + name: + description: |- + The name of the check. Must be unique within the container. + type: string + success_threshold: + description: |- + The number of times the check must succeeed before considering the container healthy. + type: integer + tcp: + $ref: '#/components/schemas/fly.TCPHealthcheck' + timeout: + description: |- + The time in seconds to wait for the check to complete. + type: integer + unhealthy: + description: |- + Unhealthy policy that determines what action to take if a container is deemed unhealthy + type: object + allOf: + - $ref: '#/components/schemas/fly.UnhealthyPolicy' + fly.ContainerHealthcheckKind: + type: string + enum: + - readiness + - liveness + x-enum-varnames: + - Readiness + - Liveness + fly.ContainerHealthcheckScheme: + type: string + enum: + - http + - https + x-enum-varnames: + - HTTP + - HTTPS + fly.ContainerMount: + type: object + properties: + name: + description: |- + The name of the volume. Must exist in the volumes field in the machine configuration + type: string + path: + description: |- + The path to mount the volume within the container + type: string + fly.DNSConfig: + type: object + properties: + dns_forward_rules: + type: array + items: + $ref: '#/components/schemas/fly.dnsForwardRule' + hostname: + type: string + hostname_fqdn: + type: string + nameservers: + type: array + items: + type: string + options: + type: array + items: + $ref: '#/components/schemas/fly.dnsOption' + searches: + type: array + items: + type: string + skip_registration: + type: boolean + fly.Duration: + type: object + properties: + time.Duration: + type: integer + x-enum-varnames: + - minDuration + - maxDuration + - Nanosecond + - Microsecond + - Millisecond + - Second + - Minute + - Hour + - minDuration + - maxDuration + - Nanosecond + - Microsecond + - Millisecond + - Second + - Minute + - Hour + - minDuration + - maxDuration + - Nanosecond + - Microsecond + - Millisecond + - Second + - Minute + - Hour + fly.EnvFrom: + description: |- + EnvVar defines an environment variable to be populated from a machine field, env_var + type: object + properties: + env_var: + description: |- + EnvVar is required and is the name of the environment variable that will be set from the + secret. It must be a valid environment variable name. + type: string + field_ref: + description: |- + FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image. + type: string + enum: + - id + - version + - app_name + - private_ip + - region + - image + fly.ExecHealthcheck: + type: object + properties: + command: + description: |- + The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"]) + type: array + items: + type: string + fly.File: + description: |- + A file that will be written to the Machine. One of RawValue or SecretName must be set. + type: object + properties: + guest_path: + description: |- + GuestPath is the path on the machine where the file will be written and must be an absolute path. + For example: /full/path/to/file.json + type: string + mode: + description: |- + Mode bits used to set permissions on this file as accepted by chmod(2). + type: integer + raw_value: + description: |- + The base64 encoded string of the file contents. + type: string + secret_name: + description: |- + The name of the secret that contains the base64 encoded file contents. + type: string + fly.HTTPHealthcheck: + type: object + properties: + headers: + description: |- + Additional headers to send with the request + type: array + items: + $ref: '#/components/schemas/fly.MachineHTTPHeader' + method: + description: |- + The HTTP method to use to when making the request + type: string + path: + description: |- + The path to send the request to + type: string + port: + description: |- + The port to connect to, often the same as internal_port + type: integer + scheme: + description: |- + Whether to use http or https + type: object + allOf: + - $ref: '#/components/schemas/fly.ContainerHealthcheckScheme' + tls_server_name: + description: |- + If the protocol is https, the hostname to use for TLS certificate validation + type: string + tls_skip_verify: + description: |- + If the protocol is https, whether or not to verify the TLS certificate + type: boolean + fly.HTTPOptions: + type: object + properties: + compress: + type: boolean + h2_backend: + type: boolean + headers_read_timeout: + type: integer + idle_timeout: + type: integer + response: + $ref: '#/components/schemas/fly.HTTPResponseOptions' + fly.HTTPResponseOptions: + type: object + properties: + headers: + type: object + additionalProperties: + type: object + pristine: + type: boolean + fly.MachineCheck: + description: |- + An optional object that defines one or more named checks. The key for each check is the check name. + type: object + properties: + grace_period: + description: |- + The time to wait after a VM starts before checking its health + type: object + allOf: + - $ref: '#/components/schemas/fly.Duration' + headers: + type: array + items: + $ref: '#/components/schemas/fly.MachineHTTPHeader' + interval: + description: |- + The time between connectivity checks + type: object + allOf: + - $ref: '#/components/schemas/fly.Duration' + kind: + description: |- + Kind of the check (informational, readiness) + type: string + enum: + - informational + - readiness + method: + description: |- + For http checks, the HTTP method to use to when making the request + type: string + path: + description: |- + For http checks, the path to send the request to + type: string + port: + description: |- + The port to connect to, often the same as internal_port + type: integer + protocol: + description: |- + For http checks, whether to use http or https + type: string + timeout: + description: |- + The maximum time a connection can take before being reported as failing its health check + type: object + allOf: + - $ref: '#/components/schemas/fly.Duration' + tls_server_name: + description: |- + If the protocol is https, the hostname to use for TLS certificate validation + type: string + tls_skip_verify: + description: |- + For http checks with https protocol, whether or not to verify the TLS certificate + type: boolean + type: + description: |- + tcp or http + type: string + fly.MachineConfig: + type: object + properties: + auto_destroy: + description: |- + Optional boolean telling the Machine to destroy itself once it’s complete (default false) + type: boolean + checks: + type: object + additionalProperties: + $ref: '#/components/schemas/fly.MachineCheck' + containers: + description: |- + Containers are a list of containers that will run in the machine. Currently restricted to + only specific organizations. + type: array + items: + $ref: '#/components/schemas/fly.ContainerConfig' + disable_machine_autostart: + description: |- + Deprecated: use Service.Autostart instead + type: boolean + dns: + $ref: '#/components/schemas/fly.DNSConfig' + env: + description: |- + An object filled with key/value pairs to be set as environment variables + type: object + additionalProperties: + type: string + files: + type: array + items: + $ref: '#/components/schemas/fly.File' + guest: + $ref: '#/components/schemas/fly.MachineGuest' + image: + description: |- + The docker image to run + type: string + init: + $ref: '#/components/schemas/fly.MachineInit' + metadata: + type: object + additionalProperties: + type: string + metrics: + $ref: '#/components/schemas/fly.MachineMetrics' + mounts: + type: array + items: + $ref: '#/components/schemas/fly.MachineMount' + processes: + type: array + items: + $ref: '#/components/schemas/fly.MachineProcess' + restart: + $ref: '#/components/schemas/fly.MachineRestart' + schedule: + type: string + services: + type: array + items: + $ref: '#/components/schemas/fly.MachineService' + size: + description: |- + Deprecated: use Guest instead + type: string + standbys: + description: |- + Standbys enable a machine to be a standby for another. In the event of a hardware failure, + the standby machine will be started. + type: array + items: + type: string + statics: + type: array + items: + $ref: '#/components/schemas/fly.Static' + stop_config: + $ref: '#/components/schemas/fly.StopConfig' + volumes: + description: |- + Volumes describe the set of volumes that can be attached to the machine. Used in conjuction + with containers + type: array + items: + $ref: '#/components/schemas/fly.VolumeConfig' + fly.MachineGuest: + type: object + properties: + cpu_kind: + type: string + cpus: + type: integer + gpu_kind: + type: string + gpus: + type: integer + host_dedication_id: + type: string + kernel_args: + type: array + items: + type: string + memory_mb: + type: integer + fly.MachineHTTPHeader: + description: |- + For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call. + type: object + properties: + name: + description: |- + The header name + type: string + values: + description: |- + The header value + type: array + items: + type: string + fly.MachineInit: + type: object + properties: + cmd: + type: array + items: + type: string + entrypoint: + type: array + items: + type: string + exec: + type: array + items: + type: string + kernel_args: + type: array + items: + type: string + swap_size_mb: + type: integer + tty: + type: boolean + fly.MachineMetrics: + type: object + properties: + https: + type: boolean + path: + type: string + port: + type: integer + fly.MachineMount: + type: object + properties: + add_size_gb: + type: integer + encrypted: + type: boolean + extend_threshold_percent: + type: integer + name: + type: string + path: + type: string + size_gb: + type: integer + size_gb_limit: + type: integer + volume: + type: string + fly.MachinePort: + type: object + properties: + end_port: + type: integer + force_https: + type: boolean + handlers: + type: array + items: + type: string + http_options: + $ref: '#/components/schemas/fly.HTTPOptions' + port: + type: integer + proxy_proto_options: + $ref: '#/components/schemas/fly.ProxyProtoOptions' + start_port: + type: integer + tls_options: + $ref: '#/components/schemas/fly.TLSOptions' + fly.MachineProcess: + type: object + properties: + cmd: + type: array + items: + type: string + entrypoint: + type: array + items: + type: string + env: + type: object + additionalProperties: + type: string + env_from: + description: |- + EnvFrom can be provided to set environment variables from machine fields. + type: array + items: + $ref: '#/components/schemas/fly.EnvFrom' + exec: + type: array + items: + type: string + ignore_app_secrets: + description: |- + IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to + and only use the secrets provided at the process level. The default/legacy behavior is to use + the secrets provided at the App level. + type: boolean + secrets: + description: |- + Secrets can be provided at the process level to explicitly indicate which secrets should be + used for the process. If not provided, the secrets provided at the machine level will be used. + type: array + items: + $ref: '#/components/schemas/fly.MachineSecret' + user: + type: string + fly.MachineRestart: + description: |- + The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/. + type: object + properties: + gpu_bid_price: + description: |- + GPU bid price for spot Machines. + type: number + max_retries: + description: |- + When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop. + type: integer + policy: + description: |- + * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. + * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. + * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. + * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price. + type: string + enum: + - no + - always + - on-failure + - spot-price + fly.MachineSecret: + description: |- + A Secret needing to be set in the environment of the Machine. env_var is required + type: object + properties: + env_var: + description: |- + EnvVar is required and is the name of the environment variable that will be set from the + secret. It must be a valid environment variable name. + type: string + name: + description: |- + Name is optional and when provided is used to reference a secret name where the EnvVar is + different from what was set as the secret name. + type: string + fly.MachineService: + type: object + properties: + autostart: + type: boolean + autostop: + description: |- + Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. + * "off" or false - Do not autostop the Machine. + * "stop" or true - Automatically stop the Machine. + * "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible. + type: string + enum: + - off + - stop + - suspend + checks: + type: array + items: + $ref: '#/components/schemas/fly.MachineCheck' + concurrency: + $ref: '#/components/schemas/fly.MachineServiceConcurrency' + force_instance_description: + type: string + force_instance_key: + type: string + internal_port: + type: integer + min_machines_running: + type: integer + ports: + type: array + items: + $ref: '#/components/schemas/fly.MachinePort' + protocol: + type: string + fly.MachineServiceConcurrency: + type: object + properties: + hard_limit: + type: integer + soft_limit: + type: integer + type: + type: string + fly.ProxyProtoOptions: + type: object + properties: + version: + type: string + fly.Static: + type: object + properties: + guest_path: + type: string + index_document: + type: string + tigris_bucket: + type: string + url_prefix: + type: string + required: + - guest_path + - url_prefix + fly.StopConfig: + type: object + properties: + signal: + type: string + timeout: + $ref: '#/components/schemas/fly.Duration' + fly.TCPHealthcheck: + type: object + properties: + port: + description: |- + The port to connect to, often the same as internal_port + type: integer + fly.TLSOptions: + type: object + properties: + alpn: + type: array + items: + type: string + default_self_signed: + type: boolean + versions: + type: array + items: + type: string + fly.TempDirVolume: + type: object + properties: + size_mb: + description: |- + The size limit of the temp dir, only applicable when using disk backed storage. + type: integer + storage_type: + description: |- + The type of storage used to back the temp dir. Either disk or memory. + type: string + fly.UnhealthyPolicy: + type: string + enum: + - stop + x-enum-varnames: + - UnhealthyPolicyStop + fly.VolumeConfig: + type: object + properties: + name: + description: |- + The name of the volume. A volume must have a unique name within an app + type: string + temp_dir: + $ref: '#/components/schemas/fly.TempDirVolume' + fly.dnsForwardRule: + type: object + properties: + addr: + type: string + basename: + type: string + fly.dnsOption: + type: object + properties: + name: + type: string + value: + type: string + flydv1.ExecResponse: + type: object + properties: + exit_code: + type: integer + exit_signal: + type: integer + stderr: + type: string + stdout: + type: string + main.statusCode: + type: string + enum: + - unknown + - insufficient_capacity + x-enum-varnames: + - unknown + - capacityErr +externalDocs: + url: https://fly.io/docs/machines/working-with-machines/ +tags: + - name: Apps + description: "This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https:\/\/fly.io\/docs\/machines\/api\/apps-resource\/) for details about using the Apps resource." + - name: Machines + description: "This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https:\/\/fly.io\/docs\/machines\/api\/machines-resource\/) for details about using the Machines resource." + - name: Volumes + description: "This site hosts documentation generated from the Fly.io Machines API OpenAPI specification. Visit our complete [Machines API docs](https:\/\/fly.io\/docs\/machines\/api\/volumes-resource\/) for details about using the Volumes resource." +x-original-swagger-version: "2.0" diff --git a/apps/cli/test/openapi/fixtures/pet_discriminator_v3.json b/apps/cli/test/openapi/fixtures/pet_discriminator_v3.json new file mode 100644 index 000000000..e0d185268 --- /dev/null +++ b/apps/cli/test/openapi/fixtures/pet_discriminator_v3.json @@ -0,0 +1,97 @@ +{ + "openapi": "3.0.2", + "info": { + "title": "Petstore", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "patch": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ], + "discriminator": { + "propertyName": "pet_type" + } + } + } + } + }, + "responses": { + "200": { + "description": "Updated" + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "required": [ + "pet_type" + ], + "properties": { + "pet_type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "pet_type" + } + }, + "Dog": { + "allOf": [ + { + "$ref": "#/components/schemas/Pet" + }, + { + "type": "object", + "properties": { + "bark": { + "type": "boolean" + }, + "breed": { + "type": "string", + "enum": [ + "Dingo", + "Husky", + "Retriever", + "Shepherd" + ] + } + } + } + ] + }, + "Cat": { + "allOf": [ + { + "$ref": "#/components/schemas/Pet" + }, + { + "type": "object", + "properties": { + "hunts": { + "type": "boolean" + }, + "age": { + "type": "integer" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/apps/cli/test/openapi/fixtures/pet_discriminator_v3.spec b/apps/cli/test/openapi/fixtures/pet_discriminator_v3.spec new file mode 100644 index 000000000..8b3190195 --- /dev/null +++ b/apps/cli/test/openapi/fixtures/pet_discriminator_v3.spec @@ -0,0 +1,184 @@ +OpenApiDocument { + version=3.0.2, + info=OpenApiInfo { + title=Petstore, + apiVersion=1.0.0, + ref=#/info, + node={title: Petstore, version: 1.0.0}, + }, + servers=[], + paths={/pets: OpenApiComponentOrRef { + ref=#/paths//pets, + component=OpenApiPathItem { + operations={patch: OpenApiOperation { + type=patch, + tags=[], + parameters=[], + requestBody=OpenApiComponentOrRef { + ref=#/paths//pets/patch/requestBody, + component=OpenApiRequestBody { + content={application/json: OpenApiMediaType { + schema=OpenApiComponentOrRef { + ref=#/paths//pets/patch/requestBody/content/application/json/schema, + component=OpenApiSchema { + oneOf=[OpenApiComponentOrRef { + ref=#/paths//pets/patch/requestBody/content/application/json/schema/oneOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Cat, + name=Cat, + node={$ref: #/components/schemas/Cat}, + }, + node={$ref: #/components/schemas/Cat}, + }, OpenApiComponentOrRef { + ref=#/paths//pets/patch/requestBody/content/application/json/schema/oneOf/1, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Dog, + name=Dog, + node={$ref: #/components/schemas/Dog}, + }, + node={$ref: #/components/schemas/Dog}, + }], + discriminator=OpenApiDiscriminator { + propertyName=pet_type, + ref=#/paths//pets/patch/requestBody/content/application/json/schema/discriminator, + node={propertyName: pet_type}, + }, + ref=#/paths//pets/patch/requestBody/content/application/json/schema, + node={oneOf: [{$ref: #/components/schemas/Cat}, {$ref: #/components/schemas/Dog}], discriminator: {propertyName: pet_type}}, + }, + }, + encoding={}, + ref=#/paths//pets/patch/requestBody/content/application/json, + node={schema: {oneOf: [{$ref: #/components/schemas/Cat}, {$ref: #/components/schemas/Dog}], discriminator: {propertyName: pet_type}}}, + }}, + ref=#/paths//pets/patch/requestBody, + node={content: {application/json: {schema: {oneOf: [{$ref: #/components/schemas/Cat}, {$ref: #/components/schemas/Dog}], discriminator: {propertyName: pet_type}}}}}, + }, + }, + responses={200: OpenApiComponentOrRef { + ref=#/paths//pets/patch/responses/200, + component=OpenApiResponse { + description=Updated, + ref=#/paths//pets/patch/responses/200, + node={description: Updated}, + }, + }}, + }}, + parameters=[], + ref=#/paths//pets, + node={patch: {requestBody: {content: {application/json: {schema: {oneOf: [{$ref: #/components/schemas/Cat}, {$ref: #/components/schemas/Dog}], discriminator: {propertyName: pet_type}}}}}, responses: {200: {description: Updated}}}}, + }, + }}, + components=OpenApiComponents { + schemas={Pet: OpenApiSchema { + name=Pet, + type=object, + properties={pet_type: OpenApiComponentOrRef { + ref=#/components/schemas/Pet/properties/pet_type, + component=OpenApiSchema { + name=pet_type, + type=string, + ref=#/components/schemas/Pet/properties/pet_type, + node={type: string}, + }, + }}, + required={pet_type}, + discriminator=OpenApiDiscriminator { + propertyName=pet_type, + ref=#/components/schemas/Pet/discriminator, + node={propertyName: pet_type}, + }, + ref=#/components/schemas/Pet, + node={type: object, required: [pet_type], properties: {pet_type: {type: string}}, discriminator: {propertyName: pet_type}}, + }, Dog: OpenApiSchema { + name=Dog, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/Dog/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Pet, + name=Pet, + node={$ref: #/components/schemas/Pet}, + }, + node={$ref: #/components/schemas/Pet}, + }, OpenApiComponentOrRef { + ref=#/components/schemas/Dog/allOf/1, + component=OpenApiSchema { + name=1, + type=object, + properties={bark: OpenApiComponentOrRef { + ref=#/components/schemas/Dog/allOf/1/properties/bark, + component=OpenApiSchema { + name=bark, + type=boolean, + ref=#/components/schemas/Dog/allOf/1/properties/bark, + node={type: boolean}, + }, + }, breed: OpenApiComponentOrRef { + ref=#/components/schemas/Dog/allOf/1/properties/breed, + component=OpenApiSchema { + name=breed, + type=string, + enumValues={Dingo, Husky, Retriever, Shepherd}, + ref=#/components/schemas/Dog/allOf/1/properties/breed, + node={type: string, enum: [Dingo, Husky, Retriever, Shepherd]}, + }, + }}, + ref=#/components/schemas/Dog/allOf/1, + node={type: object, properties: {bark: {type: boolean}, breed: {type: string, enum: [Dingo, Husky, Retriever, Shepherd]}}}, + }, + }], + ref=#/components/schemas/Dog, + node={allOf: [{$ref: #/components/schemas/Pet}, {type: object, properties: {bark: {type: boolean}, breed: {type: string, enum: [Dingo, Husky, Retriever, Shepherd]}}}]}, + }, Cat: OpenApiSchema { + name=Cat, + allOf=[OpenApiComponentOrRef { + ref=#/components/schemas/Cat/allOf/0, + reference=OpenApiSchemaReference { + ref=#/components/schemas/Pet, + name=Pet, + node={$ref: #/components/schemas/Pet}, + }, + node={$ref: #/components/schemas/Pet}, + }, OpenApiComponentOrRef { + ref=#/components/schemas/Cat/allOf/1, + component=OpenApiSchema { + name=1, + type=object, + properties={hunts: OpenApiComponentOrRef { + ref=#/components/schemas/Cat/allOf/1/properties/hunts, + component=OpenApiSchema { + name=hunts, + type=boolean, + ref=#/components/schemas/Cat/allOf/1/properties/hunts, + node={type: boolean}, + }, + }, age: OpenApiComponentOrRef { + ref=#/components/schemas/Cat/allOf/1/properties/age, + component=OpenApiSchema { + name=age, + type=integer, + ref=#/components/schemas/Cat/allOf/1/properties/age, + node={type: integer}, + }, + }}, + ref=#/components/schemas/Cat/allOf/1, + node={type: object, properties: {hunts: {type: boolean}, age: {type: integer}}}, + }, + }], + ref=#/components/schemas/Cat, + node={allOf: [{$ref: #/components/schemas/Pet}, {type: object, properties: {hunts: {type: boolean}, age: {type: integer}}}]}, + }}, + responses={}, + parameters={}, + requestBodies={}, + headers={}, + securitySchemes={}, + paths={}, + ref=#/components, + node={schemas: {Pet: {type: object, required: [pet_type], properties: {pet_type: {type: string}}, discriminator: {propertyName: pet_type}}, Dog: {allOf: [{$ref: #/components/schemas/Pet}, {type: object, properties: {bark: {type: boolean}, breed: {type: string, enum: [Dingo, Husky, Retriever, Shepherd]}}}]}, Cat: {allOf: [{$ref: #/components/schemas/Pet}, {type: object, properties: {hunts: {type: boolean}, age: {type: integer}}}]}}}, + }, + securityRequirements=[], + tags=[], + ref=#, + node={openapi: 3.0.2, info: {title: Petstore, version: 1.0.0}, paths: {/pets: {patch: {requestBody: {content: {application/json: {schema: {oneOf: [{$ref: #/components/schemas/Cat}, {$ref: #/components/schemas/Dog}], discriminator: {propertyName: pet_type}}}}}, responses: {200: {description: Updated}}}}}, components: {schemas: {Pet: {type: object, required: [pet_type], properties: {pet_type: {type: string}}, discriminator: {propertyName: pet_type}}, Dog: {allOf: [{$ref: #/components/schemas/Pet}, {type: object, properties: {bark: {type: boolean}, breed: {type: string, enum: [Dingo, Husky, Retriever, Shepherd]}}}]}, Cat: {allOf: [{$ref: #/components/schemas/Pet}, {type: object, properties: {hunts: {type: boolean}, age: {type: integer}}}]}}}}, +} \ No newline at end of file diff --git a/apps/cli/test/openapi/fixtures/pet_discriminator_v3.yaml b/apps/cli/test/openapi/fixtures/pet_discriminator_v3.yaml new file mode 100644 index 000000000..9d7a73300 --- /dev/null +++ b/apps/cli/test/openapi/fixtures/pet_discriminator_v3.yaml @@ -0,0 +1,54 @@ +openapi: '3.0.2' +info: + title: Petstore + version: '1.0.0' +paths: + '/pets': + patch: + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/Dog' + discriminator: + propertyName: pet_type + responses: + '200': + description: |- + Updated +components: + schemas: + Pet: + type: object + properties: + pet_type: + type: string + required: + - pet_type + discriminator: + propertyName: pet_type + Dog: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + bark: + type: boolean + breed: + type: string + enum: + - Dingo + - Husky + - Retriever + - Shepherd + Cat: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + hunts: + type: boolean + age: + type: integer diff --git a/apps/cli/test/openapi/openapi_test.dart b/apps/cli/test/openapi/openapi_test.dart new file mode 100644 index 000000000..5c56c9fd0 --- /dev/null +++ b/apps/cli/test/openapi/openapi_test.dart @@ -0,0 +1,70 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:celest_cli/src/context.dart'; +import 'package:celest_cli/src/openapi/loader/openapi_loader.dart'; +import 'package:celest_cli/src/openapi/renderer/openapi_renderer.dart'; +import 'package:test/test.dart'; +import 'package:yaml/src/equality.dart' as equality; +import 'package:yaml/yaml.dart'; + +void main() { + group('OpenAPI', () { + final fixturesDir = + Directory.current.uri.resolve('./test/openapi/fixtures'); + final fixtureSpecs = Directory.fromUri(fixturesDir) + .listSync() + .whereType() + .where((f) => f.path.endsWith('.json')); + + for (final fixtureSpec in fixtureSpecs) { + final basename = p.basename(fixtureSpec.path); + group(basename, () { + final fixtureSpecJson = fixtureSpec.readAsStringSync(); + + test('can load document', () { + expect( + () => loadOpenApiDocument( + fixtureSpecJson, + sourceUri: fixtureSpec.uri, + ), + returnsNormally, + ); + }); + + test('can render to YAML', () { + final document = loadOpenApiDocument( + fixtureSpecJson, + sourceUri: fixtureSpec.uri, + ); + final documentFile = File(p.setExtension(fixtureSpec.path, '.spec')); + documentFile.writeAsStringSync(document.toString()); + + final rendered = document.toYaml(); + final renderedFile = File(p.setExtension(fixtureSpec.path, '.yaml')); + renderedFile.writeAsStringSync(rendered); + + final documentJson = + jsonDecode(fixtureSpecJson) as Map; + final renderedYaml = loadYaml(rendered); + expect(renderedYaml, equals(deepEqualsMap(documentJson))); + }); + }); + } + }); +} + +// Copied from `package:yaml` + +/// Returns a matcher that asserts that the value equals [expected]. +/// +/// This handles recursive loops and considers `NaN` to equal itself. +Matcher deepEquals(Object? expected) => predicate( + (actual) => equality.deepEquals(actual, expected), 'equals $expected'); + +/// Constructs a new yaml.YamlMap, optionally from a normal Map. +Map deepEqualsMap([Map? from]) { + final map = equality.deepEqualsMap(); + if (from != null) map.addAll(from); + return map; +}