debian-forge-composer/internal/cloudapi/v2/openapi.v2.gen.go
Sanne Raymaekers 0b11dc6b59 cloudapi/v2: mark md5 signature as required in package metadata
Technically osbuild/osbuild-composer#4564 broke the api spec by marking
a required field as non-required. Fix this by using allOf.
2025-03-21 10:06:42 +01:00

2028 lines
77 KiB
Go

// Package v2 provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.
package v2
import (
"bytes"
"compress/gzip"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"net/url"
"path"
"strings"
"github.com/deepmap/oapi-codegen/pkg/runtime"
"github.com/getkin/kin-openapi/openapi3"
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
)
const (
BearerScopes = "Bearer.Scopes"
)
// Defines values for AzureUploadOptionsHyperVGeneration.
const (
AzureUploadOptionsHyperVGenerationV1 AzureUploadOptionsHyperVGeneration = "V1"
AzureUploadOptionsHyperVGenerationV2 AzureUploadOptionsHyperVGeneration = "V2"
)
// Defines values for BlueprintCustomizationsPartitioningMode.
const (
BlueprintCustomizationsPartitioningModeAutoLvm BlueprintCustomizationsPartitioningMode = "auto-lvm"
BlueprintCustomizationsPartitioningModeLvm BlueprintCustomizationsPartitioningMode = "lvm"
BlueprintCustomizationsPartitioningModeRaw BlueprintCustomizationsPartitioningMode = "raw"
)
// Defines values for ComposeStatusValue.
const (
ComposeStatusValueFailure ComposeStatusValue = "failure"
ComposeStatusValuePending ComposeStatusValue = "pending"
ComposeStatusValueSuccess ComposeStatusValue = "success"
)
// Defines values for CustomizationsPartitioningMode.
const (
CustomizationsPartitioningModeAutoLvm CustomizationsPartitioningMode = "auto-lvm"
CustomizationsPartitioningModeLvm CustomizationsPartitioningMode = "lvm"
CustomizationsPartitioningModeRaw CustomizationsPartitioningMode = "raw"
)
// Defines values for ImageSBOMPipelinePurpose.
const (
ImageSBOMPipelinePurposeBuildroot ImageSBOMPipelinePurpose = "buildroot"
ImageSBOMPipelinePurposeImage ImageSBOMPipelinePurpose = "image"
)
// Defines values for ImageSBOMSbomType.
const (
ImageSBOMSbomTypeSpdx ImageSBOMSbomType = "spdx"
)
// Defines values for ImageStatusValue.
const (
ImageStatusValueBuilding ImageStatusValue = "building"
ImageStatusValueFailure ImageStatusValue = "failure"
ImageStatusValuePending ImageStatusValue = "pending"
ImageStatusValueRegistering ImageStatusValue = "registering"
ImageStatusValueSuccess ImageStatusValue = "success"
ImageStatusValueUploading ImageStatusValue = "uploading"
)
// Defines values for ImageTypes.
const (
ImageTypesAws ImageTypes = "aws"
ImageTypesAwsHaRhui ImageTypes = "aws-ha-rhui"
ImageTypesAwsRhui ImageTypes = "aws-rhui"
ImageTypesAwsSapRhui ImageTypes = "aws-sap-rhui"
ImageTypesAzure ImageTypes = "azure"
ImageTypesAzureEap7Rhui ImageTypes = "azure-eap7-rhui"
ImageTypesAzureRhui ImageTypes = "azure-rhui"
ImageTypesAzureSapRhui ImageTypes = "azure-sap-rhui"
ImageTypesEdgeCommit ImageTypes = "edge-commit"
ImageTypesEdgeContainer ImageTypes = "edge-container"
ImageTypesEdgeInstaller ImageTypes = "edge-installer"
ImageTypesGcp ImageTypes = "gcp"
ImageTypesGcpRhui ImageTypes = "gcp-rhui"
ImageTypesGuestImage ImageTypes = "guest-image"
ImageTypesImageInstaller ImageTypes = "image-installer"
ImageTypesIotBootableContainer ImageTypes = "iot-bootable-container"
ImageTypesIotCommit ImageTypes = "iot-commit"
ImageTypesIotContainer ImageTypes = "iot-container"
ImageTypesIotInstaller ImageTypes = "iot-installer"
ImageTypesIotRawImage ImageTypes = "iot-raw-image"
ImageTypesIotSimplifiedInstaller ImageTypes = "iot-simplified-installer"
ImageTypesLiveInstaller ImageTypes = "live-installer"
ImageTypesMinimalRaw ImageTypes = "minimal-raw"
ImageTypesOci ImageTypes = "oci"
ImageTypesVsphere ImageTypes = "vsphere"
ImageTypesVsphereOva ImageTypes = "vsphere-ova"
ImageTypesWsl ImageTypes = "wsl"
)
// Defines values for UploadStatusValue.
const (
UploadStatusValueFailure UploadStatusValue = "failure"
UploadStatusValuePending UploadStatusValue = "pending"
UploadStatusValueRunning UploadStatusValue = "running"
UploadStatusValueSuccess UploadStatusValue = "success"
)
// Defines values for UploadTypes.
const (
UploadTypesAws UploadTypes = "aws"
UploadTypesAwsS3 UploadTypes = "aws.s3"
UploadTypesAzure UploadTypes = "azure"
UploadTypesContainer UploadTypes = "container"
UploadTypesGcp UploadTypes = "gcp"
UploadTypesLocal UploadTypes = "local"
UploadTypesOciObjectstorage UploadTypes = "oci.objectstorage"
UploadTypesPulpOstree UploadTypes = "pulp.ostree"
)
// AWSEC2CloneCompose defines model for AWSEC2CloneCompose.
type AWSEC2CloneCompose struct {
Region string `json:"region"`
ShareWithAccounts *[]string `json:"share_with_accounts,omitempty"`
}
// AWSEC2UploadOptions defines model for AWSEC2UploadOptions.
type AWSEC2UploadOptions struct {
Region string `json:"region"`
ShareWithAccounts []string `json:"share_with_accounts"`
SnapshotName *string `json:"snapshot_name,omitempty"`
}
// AWSEC2UploadStatus defines model for AWSEC2UploadStatus.
type AWSEC2UploadStatus struct {
Ami string `json:"ami"`
Region string `json:"region"`
}
// AWSS3UploadOptions defines model for AWSS3UploadOptions.
type AWSS3UploadOptions struct {
// If set to false (the default value), a long, obfuscated URL
// is returned. Its expiration might be sooner than for other upload
// targets.
//
// If set to true, a shorter URL is returned and
// its expiration is the same as for the other upload targets.
Public *bool `json:"public,omitempty"`
Region string `json:"region"`
}
// AWSS3UploadStatus defines model for AWSS3UploadStatus.
type AWSS3UploadStatus struct {
Url string `json:"url"`
}
// AzureUploadOptions defines model for AzureUploadOptions.
type AzureUploadOptions struct {
// Choose the VM Image HyperV generation, different features on Azure are available
// depending on the HyperV generation.
HyperVGeneration *AzureUploadOptionsHyperVGeneration `json:"hyper_v_generation,omitempty"`
// Name of the uploaded image. It must be unique in the given resource group.
// If name is omitted from the request, a random one based on a UUID is
// generated.
ImageName *string `json:"image_name,omitempty"`
// Location of the provided resource_group, where the image should be uploaded and registered.
// How to list all locations:
// https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az_account_list_locations'
// If the location is not specified, it is deducted from the provided resource_group.
Location *string `json:"location,omitempty"`
// Name of the resource group where the image should be uploaded.
ResourceGroup string `json:"resource_group"`
// ID of subscription where the image should be uploaded.
SubscriptionId string `json:"subscription_id"`
// ID of the tenant where the image should be uploaded.
// How to find it in the Azure Portal:
// https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-how-to-find-tenant
TenantId string `json:"tenant_id"`
}
// Choose the VM Image HyperV generation, different features on Azure are available
// depending on the HyperV generation.
type AzureUploadOptionsHyperVGeneration string
// AzureUploadStatus defines model for AzureUploadStatus.
type AzureUploadStatus struct {
ImageName string `json:"image_name"`
}
// Blueprint defines model for Blueprint.
type Blueprint struct {
// Container images to embed into the final artfact
Containers *[]Container `json:"containers,omitempty"`
Customizations *BlueprintCustomizations `json:"customizations,omitempty"`
Description *string `json:"description,omitempty"`
// The distribution to use for the compose. If left empty the host
// distro will be used.
Distro *string `json:"distro,omitempty"`
EnabledModules *[]Module `json:"enabled_modules,omitempty"`
// Package groups to be installed
Groups *[]PackageGroup `json:"groups,omitempty"`
// An alias for packages, retained for backwards compatability
Modules *[]Package `json:"modules,omitempty"`
Name string `json:"name"`
// Packages to be installed
Packages *[]Package `json:"packages,omitempty"`
// A semver version number
Version *string `json:"version,omitempty"`
}
// BlueprintCustomizations defines model for BlueprintCustomizations.
type BlueprintCustomizations struct {
Cacerts *CACertsCustomization `json:"cacerts,omitempty"`
// Directories to create in the final artifact
Directories *[]Directory `json:"directories,omitempty"`
// FIDO device onboard configuration
Fdo *FDO `json:"fdo,omitempty"`
// Files to create in the final artifact
Files *[]BlueprintFile `json:"files,omitempty"`
// List of filesystem mountpoints to create
Filesystem *[]BlueprintFilesystem `json:"filesystem,omitempty"`
// Enable FIPS mode
Fips *bool `json:"fips,omitempty"`
// Firewalld configuration
Firewall *BlueprintFirewall `json:"firewall,omitempty"`
// List of groups to create
Group *[]Group `json:"group,omitempty"`
// Configures the hostname
Hostname *string `json:"hostname,omitempty"`
// Ignition configuration
Ignition *Ignition `json:"ignition,omitempty"`
// Name of the installation device, currently only useful for the edge-simplified-installer type
InstallationDevice *string `json:"installation_device,omitempty"`
Installer *Installer `json:"installer,omitempty"`
Kernel *Kernel `json:"kernel,omitempty"`
// Locale configuration
Locale *Locale `json:"locale,omitempty"`
Openscap *BlueprintOpenSCAP `json:"openscap,omitempty"`
// Select how the disk image will be partitioned. 'auto-lvm' will use raw unless
// there are one or more mountpoints in which case it will use LVM. 'lvm' always
// uses LVM, even when there are no extra mountpoints. 'raw' uses raw partitions
// even when there are one or more mountpoints.
PartitioningMode *BlueprintCustomizationsPartitioningMode `json:"partitioning_mode,omitempty"`
// Repositories to write to /etc/yum.repos.d/ in the final image. Note
// that these are not used at build time.
Repositories *[]BlueprintRepository `json:"repositories,omitempty"`
Rhsm *RHSMCustomization `json:"rhsm,omitempty"`
Rpm *RPMCustomization `json:"rpm,omitempty"`
Services *Services `json:"services,omitempty"`
// List of ssh keys
Sshkey *[]SSHKey `json:"sshkey,omitempty"`
// Timezone configuration
Timezone *Timezone `json:"timezone,omitempty"`
// List of users to create
User *[]BlueprintUser `json:"user,omitempty"`
}
// Select how the disk image will be partitioned. 'auto-lvm' will use raw unless
// there are one or more mountpoints in which case it will use LVM. 'lvm' always
// uses LVM, even when there are no extra mountpoints. 'raw' uses raw partitions
// even when there are one or more mountpoints.
type BlueprintCustomizationsPartitioningMode string
// A custom file to create in the final artifact.
type BlueprintFile struct {
// Contents of the file as plain text
Data *string `json:"data,omitempty"`
// Group of the file as a gid or a group name
Group *interface{} `json:"group,omitempty"`
// Permissions string for the file in octal format
Mode *string `json:"mode,omitempty"`
// Path to the file
Path string `json:"path"`
// Owner of the file as a uid or a user name
User *interface{} `json:"user,omitempty"`
}
// BlueprintFilesystem defines model for BlueprintFilesystem.
type BlueprintFilesystem struct {
// size of the filesystem in bytes
Minsize uint64 `json:"minsize"`
Mountpoint string `json:"mountpoint"`
}
// Firewalld configuration
type BlueprintFirewall struct {
// List of ports (or port ranges) and protocols to open
Ports *[]string `json:"ports,omitempty"`
// Firewalld services to enable or disable
Services *FirewallServices `json:"services,omitempty"`
Zones *[]FirewallZones `json:"zones,omitempty"`
}
// BlueprintOpenSCAP defines model for BlueprintOpenSCAP.
type BlueprintOpenSCAP struct {
Datastream *string `json:"datastream,omitempty"`
JsonTailoring *OpenSCAPJSONTailoring `json:"json_tailoring,omitempty"`
// Puts a specified policy ID in the RHSM facts, so that any instances registered to
// insights will be automatically connected to the compliance policy in the console.
PolicyId *string `json:"policy_id,omitempty"`
ProfileId string `json:"profile_id"`
Tailoring *OpenSCAPTailoring `json:"tailoring,omitempty"`
}
// BlueprintRepository defines model for BlueprintRepository.
type BlueprintRepository struct {
Baseurls *[]string `json:"baseurls,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Filename *string `json:"filename,omitempty"`
Gpgcheck *bool `json:"gpgcheck,omitempty"`
Gpgkeys *[]string `json:"gpgkeys,omitempty"`
Id string `json:"id"`
Metalink *string `json:"metalink,omitempty"`
Mirrorlist *string `json:"mirrorlist,omitempty"`
// Disables modularity filtering for this repository.
ModuleHotfixes *bool `json:"module_hotfixes,omitempty"`
Name *string `json:"name,omitempty"`
Priority *int `json:"priority,omitempty"`
RepoGpgcheck *bool `json:"repo_gpgcheck,omitempty"`
Sslverify *bool `json:"sslverify,omitempty"`
}
// BlueprintUser defines model for BlueprintUser.
type BlueprintUser struct {
Description *string `json:"description,omitempty"`
// Group id to use instead of the default
Gid *int `json:"gid,omitempty"`
// A list of additional groups to add the user to
Groups *[]string `json:"groups,omitempty"`
// The user's home directory
Home *string `json:"home,omitempty"`
// ssh public key
Key *string `json:"key,omitempty"`
Name string `json:"name"`
// If the password starts with $6$, $5$, or $2b$ it will be stored as
// an encrypted password. Otherwise it will be treated as a plain text
// password.
Password *string `json:"password,omitempty"`
// Login shell to use
Shell *string `json:"shell,omitempty"`
// User id to use instead of the default
Uid *int `json:"uid,omitempty"`
}
// CACertsCustomization defines model for CACertsCustomization.
type CACertsCustomization struct {
PemCerts []string `json:"pem_certs"`
}
// CloneComposeBody defines model for CloneComposeBody.
type CloneComposeBody interface{}
// CloneComposeResponse defines model for CloneComposeResponse.
type CloneComposeResponse struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded fields due to inline allOf schema
Id string `json:"id"`
}
// CloneStatus defines model for CloneStatus.
type CloneStatus struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded struct due to allOf(#/components/schemas/UploadStatus)
UploadStatus `yaml:",inline"`
}
// ComposeId defines model for ComposeId.
type ComposeId struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded fields due to inline allOf schema
Id string `json:"id"`
}
// ComposeList defines model for ComposeList.
type ComposeList struct {
// Embedded struct due to allOf(#/components/schemas/List)
List `yaml:",inline"`
// Embedded fields due to inline allOf schema
Items []ComposeStatus `json:"items"`
}
// ComposeLogs defines model for ComposeLogs.
type ComposeLogs struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded fields due to inline allOf schema
ImageBuilds []interface{} `json:"image_builds"`
Koji *KojiLogs `json:"koji,omitempty"`
}
// ComposeManifests defines model for ComposeManifests.
type ComposeManifests struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded fields due to inline allOf schema
Manifests []interface{} `json:"manifests"`
}
// ComposeMetadata defines model for ComposeMetadata.
type ComposeMetadata struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded fields due to inline allOf schema
// ID (hash) of the built commit
OstreeCommit *string `json:"ostree_commit,omitempty"`
// Package list including NEVRA
Packages *[]PackageMetadata `json:"packages,omitempty"`
Request *ComposeRequest `json:"request,omitempty"`
}
// ComposeRequest defines model for ComposeRequest.
type ComposeRequest struct {
Blueprint *Blueprint `json:"blueprint,omitempty"`
Customizations *Customizations `json:"customizations,omitempty"`
Distribution string `json:"distribution"`
ImageRequest *ImageRequest `json:"image_request,omitempty"`
ImageRequests *[]ImageRequest `json:"image_requests,omitempty"`
Koji *Koji `json:"koji,omitempty"`
}
// ComposeSBOMs defines model for ComposeSBOMs.
type ComposeSBOMs struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded fields due to inline allOf schema
// The SBOM documents for each image built in the compose.
Items [][]ImageSBOM `json:"items"`
}
// ComposeStatus defines model for ComposeStatus.
type ComposeStatus struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded fields due to inline allOf schema
ImageStatus ImageStatus `json:"image_status"`
ImageStatuses *[]ImageStatus `json:"image_statuses,omitempty"`
KojiStatus *KojiStatus `json:"koji_status,omitempty"`
Status ComposeStatusValue `json:"status"`
}
// ComposeStatusError defines model for ComposeStatusError.
type ComposeStatusError struct {
Details *interface{} `json:"details,omitempty"`
Id int `json:"id"`
Reason string `json:"reason"`
}
// ComposeStatusValue defines model for ComposeStatusValue.
type ComposeStatusValue string
// Container defines model for Container.
type Container struct {
// Name to use for the container from the image
Name *string `json:"name,omitempty"`
// Reference to the container to embed
Source string `json:"source"`
// Control TLS verifification
TlsVerify *bool `json:"tls_verify,omitempty"`
}
// ContainerUploadOptions defines model for ContainerUploadOptions.
type ContainerUploadOptions struct {
// Name for the created container image
Name *string `json:"name,omitempty"`
// Tag for the created container image
Tag *string `json:"tag,omitempty"`
}
// ContainerUploadStatus defines model for ContainerUploadStatus.
type ContainerUploadStatus struct {
// Digest of the manifest of the uploaded container on the registry
Digest string `json:"digest"`
// FQDN of the uploaded image
Url string `json:"url"`
}
// CustomRepository defines model for CustomRepository.
type CustomRepository struct {
Baseurl *[]string `json:"baseurl,omitempty"`
CheckGpg *bool `json:"check_gpg,omitempty"`
CheckRepoGpg *bool `json:"check_repo_gpg,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Filename *string `json:"filename,omitempty"`
Gpgkey *[]string `json:"gpgkey,omitempty"`
Id string `json:"id"`
Metalink *string `json:"metalink,omitempty"`
Mirrorlist *string `json:"mirrorlist,omitempty"`
ModuleHotfixes *bool `json:"module_hotfixes,omitempty"`
Name *string `json:"name,omitempty"`
Priority *int `json:"priority,omitempty"`
SslVerify *bool `json:"ssl_verify,omitempty"`
}
// Customizations defines model for Customizations.
type Customizations struct {
Cacerts *CACertsCustomization `json:"cacerts,omitempty"`
Containers *[]Container `json:"containers,omitempty"`
// Extra repositories for packages specified in customizations. These
// repositories will be used to depsolve and retrieve packages. Additionally,
// these packages will be saved and imported to the `/etc/yum.repos.d/` directory
// on the image
CustomRepositories *[]CustomRepository `json:"custom_repositories,omitempty"`
Directories *[]Directory `json:"directories,omitempty"`
EnabledModules *[]Module `json:"enabled_modules,omitempty"`
// FIDO device onboard configuration
Fdo *FDO `json:"fdo,omitempty"`
Files *[]File `json:"files,omitempty"`
Filesystem *[]Filesystem `json:"filesystem,omitempty"`
// System FIPS mode setup
Fips *FIPS `json:"fips,omitempty"`
// Firewalld configuration
Firewall *FirewallCustomization `json:"firewall,omitempty"`
// List of groups to create
Groups *[]Group `json:"groups,omitempty"`
// Configures the hostname
Hostname *string `json:"hostname,omitempty"`
// Ignition configuration
Ignition *Ignition `json:"ignition,omitempty"`
// Name of the installation device, currently only useful for the edge-simplified-installer type
InstallationDevice *string `json:"installation_device,omitempty"`
Installer *Installer `json:"installer,omitempty"`
Kernel *Kernel `json:"kernel,omitempty"`
// Locale configuration
Locale *Locale `json:"locale,omitempty"`
Openscap *OpenSCAP `json:"openscap,omitempty"`
Packages *[]string `json:"packages,omitempty"`
// Select how the disk image will be partitioned. 'auto-lvm' will use raw unless
// there are one or more mountpoints in which case it will use LVM. 'lvm' always
// uses LVM, even when there are no extra mountpoints. 'raw' uses raw partitions
// even when there are one or more mountpoints.
PartitioningMode *CustomizationsPartitioningMode `json:"partitioning_mode,omitempty"`
// Extra repositories for packages specified in customizations. These
// repositories will only be used to depsolve and retrieve packages
// for the OS itself (they will not be available for the build root or
// any other part of the build process). The package_sets field for these
// repositories is ignored.
PayloadRepositories *[]Repository `json:"payload_repositories,omitempty"`
Rhsm *RHSMCustomization `json:"rhsm,omitempty"`
Rpm *RPMCustomization `json:"rpm,omitempty"`
Services *Services `json:"services,omitempty"`
Subscription *Subscription `json:"subscription,omitempty"`
// Timezone configuration
Timezone *Timezone `json:"timezone,omitempty"`
Users *[]User `json:"users,omitempty"`
}
// Select how the disk image will be partitioned. 'auto-lvm' will use raw unless
// there are one or more mountpoints in which case it will use LVM. 'lvm' always
// uses LVM, even when there are no extra mountpoints. 'raw' uses raw partitions
// even when there are one or more mountpoints.
type CustomizationsPartitioningMode string
// DNFPluginConfig defines model for DNFPluginConfig.
type DNFPluginConfig struct {
Enabled *bool `json:"enabled,omitempty"`
}
// DepsolveRequest defines model for DepsolveRequest.
type DepsolveRequest struct {
Architecture string `json:"architecture"`
Blueprint Blueprint `json:"blueprint"`
Distribution string `json:"distribution"`
Repositories *[]Repository `json:"repositories,omitempty"`
}
// DepsolveResponse defines model for DepsolveResponse.
type DepsolveResponse struct {
// Package list including NEVRA
Packages []PackageMetadataCommon `json:"packages"`
}
// A custom directory to create in the final artifact.
type Directory struct {
// Ensure that the parent directories exist
EnsureParents *bool `json:"ensure_parents,omitempty"`
// Group of the directory as a group name or a gid
Group *interface{} `json:"group,omitempty"`
// Permissions string for the directory in octal format
Mode *string `json:"mode,omitempty"`
// Path to the directory
Path string `json:"path"`
// Owner of the directory as a user name or a uid
User *interface{} `json:"user,omitempty"`
}
// DistributionList defines model for DistributionList.
type DistributionList struct {
// Distribution name
Map *DistributionList_Map `json:"map,omitempty"`
}
// Distribution name
type DistributionList_Map struct {
AdditionalProperties map[string]interface{} `json:"-"`
}
// Error defines model for Error.
type Error struct {
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
ObjectReference `yaml:",inline"`
// Embedded fields due to inline allOf schema
Code string `json:"code"`
Details *interface{} `json:"details,omitempty"`
OperationId string `json:"operation_id"`
Reason string `json:"reason"`
}
// ErrorList defines model for ErrorList.
type ErrorList struct {
// Embedded struct due to allOf(#/components/schemas/List)
List `yaml:",inline"`
// Embedded fields due to inline allOf schema
Items []Error `json:"items"`
}
// FIDO device onboard configuration
type FDO struct {
DiMfgStringTypeMacIface *string `json:"di_mfg_string_type_mac_iface,omitempty"`
DiunPubKeyHash *string `json:"diun_pub_key_hash,omitempty"`
DiunPubKeyInsecure *string `json:"diun_pub_key_insecure,omitempty"`
DiunPubKeyRootCerts *string `json:"diun_pub_key_root_certs,omitempty"`
ManufacturingServerUrl *string `json:"manufacturing_server_url,omitempty"`
}
// System FIPS mode setup
type FIPS struct {
// Enables the system FIPS mode
Enabled *bool `json:"enabled,omitempty"`
}
// A custom file to create in the final artifact.
type File struct {
// Contents of the file as plain text
Data *string `json:"data,omitempty"`
// Ensure that the parent directories exist
EnsureParents *bool `json:"ensure_parents,omitempty"`
// Group of the file as a gid or a group name
Group *interface{} `json:"group,omitempty"`
// Permissions string for the file in octal format
Mode *string `json:"mode,omitempty"`
// Path to the file
Path string `json:"path"`
// Owner of the file as a uid or a user name
User *interface{} `json:"user,omitempty"`
}
// Filesystem defines model for Filesystem.
type Filesystem struct {
// size of the filesystem in bytes
MinSize uint64 `json:"min_size"`
Mountpoint string `json:"mountpoint"`
}
// Firewalld configuration
type FirewallCustomization struct {
// List of ports (or port ranges) and protocols to open
Ports *[]string `json:"ports,omitempty"`
// Firewalld services to enable or disable
Services *FirewallServices `json:"services,omitempty"`
}
// Firewalld services to enable or disable
type FirewallServices struct {
// List of services to disable
Disabled *[]string `json:"disabled,omitempty"`
// List of services to enable
Enabled *[]string `json:"enabled,omitempty"`
}
// Bind a list of network sources to a zone to restrict traffic from
// those sources based on the settings of the zone.
type FirewallZones struct {
// name of the zone, if left empty the sources will apply to
// the default zone.
Name *string `json:"name,omitempty"`
// List of sources for the zone
Sources *[]string `json:"sources,omitempty"`
}
// GCPUploadOptions defines model for GCPUploadOptions.
type GCPUploadOptions struct {
// Name of an existing STANDARD Storage class Bucket.
Bucket *string `json:"bucket,omitempty"`
// The name to use for the imported and shared Compute Engine image.
// The image name must be unique within the GCP project, which is used
// for the OS image upload and import. If not specified a random
// 'composer-api-<uuid>' string is used as the image name.
ImageName *string `json:"image_name,omitempty"`
// The GCP region where the OS image will be imported to and shared from.
// The value must be a valid GCP location. See https://cloud.google.com/storage/docs/locations.
// If not specified, the multi-region location closest to the source
// (source Storage Bucket location) is chosen automatically.
Region string `json:"region"`
// List of valid Google accounts to share the imported Compute Engine image with.
// Each string must contain a specifier of the account type. Valid formats are:
// - 'user:{emailid}': An email address that represents a specific
// Google account. For example, 'alice@example.com'.
// - 'serviceAccount:{emailid}': An email address that represents a
// service account. For example, 'my-other-app@appspot.gserviceaccount.com'.
// - 'group:{emailid}': An email address that represents a Google group.
// For example, 'admins@example.com'.
// - 'domain:{domain}': The G Suite domain (primary) that represents all
// the users of that domain. For example, 'google.com' or 'example.com'.
// If not specified, the imported Compute Engine image is not shared with any
// account.
ShareWithAccounts *[]string `json:"share_with_accounts,omitempty"`
}
// GCPUploadStatus defines model for GCPUploadStatus.
type GCPUploadStatus struct {
ImageName string `json:"image_name"`
ProjectId string `json:"project_id"`
}
// Group defines model for Group.
type Group struct {
// Group id of the group to create (optional)
Gid *int `json:"gid,omitempty"`
// Name of the group to create
Name string `json:"name"`
}
// Ignition configuration
type Ignition struct {
Embedded *IgnitionEmbedded `json:"embedded,omitempty"`
Firstboot *IgnitionFirstboot `json:"firstboot,omitempty"`
}
// IgnitionEmbedded defines model for IgnitionEmbedded.
type IgnitionEmbedded struct {
Config string `json:"config"`
}
// IgnitionFirstboot defines model for IgnitionFirstboot.
type IgnitionFirstboot struct {
// Provisioning URL
Url string `json:"url"`
}
// ImageRequest defines model for ImageRequest.
type ImageRequest struct {
Architecture string `json:"architecture"`
ImageType ImageTypes `json:"image_type"`
Ostree *OSTree `json:"ostree,omitempty"`
Repositories []Repository `json:"repositories"`
// Size of image, in bytes. When set to 0 the image size is a minimum
// defined by the image type.
Size *uint64 `json:"size,omitempty"`
// Options for a given upload destination.
// This should really be oneOf but AWSS3UploadOptions is a subset of
// AWSEC2UploadOptions. This means that all AWSEC2UploadOptions objects
// are also valid AWSS3UploadOptionas objects which violates the oneOf
// rules. Therefore, we have to use anyOf here but be aware that it isn't
// possible to mix and match more schemas together.
UploadOptions *UploadOptions `json:"upload_options,omitempty"`
// The type and options for multiple upload targets. Each item defines
// a separate upload destination with its own options. Multiple
// different targets as well as multiple targets of the same kind are
// supported.
UploadTargets *[]UploadTarget `json:"upload_targets,omitempty"`
}
// ImageSBOM defines model for ImageSBOM.
type ImageSBOM struct {
// The name of the osbuild pipeline which has the packages described
// in the SBOM installed.
PipelineName string `json:"pipeline_name"`
// The purpose of the pipeline. The `buildroot` pipeline was used for
// the build environment dueing the image build. The `image` pipeline
// represents the actual content of the image. Due to the nature of
// some image types, there may be multiple pipelines of the same
// purpose.
PipelinePurpose ImageSBOMPipelinePurpose `json:"pipeline_purpose"`
// The SBOM document in the 'sbom_type' format.
Sbom interface{} `json:"sbom"`
// The type of the SBOM document. Currently only SPDX is supported.
SbomType ImageSBOMSbomType `json:"sbom_type"`
}
// The purpose of the pipeline. The `buildroot` pipeline was used for
// the build environment dueing the image build. The `image` pipeline
// represents the actual content of the image. Due to the nature of
// some image types, there may be multiple pipelines of the same
// purpose.
type ImageSBOMPipelinePurpose string
// The type of the SBOM document. Currently only SPDX is supported.
type ImageSBOMSbomType string
// ImageStatus defines model for ImageStatus.
type ImageStatus struct {
Error *ComposeStatusError `json:"error,omitempty"`
Status ImageStatusValue `json:"status"`
UploadStatus *UploadStatus `json:"upload_status,omitempty"`
UploadStatuses *[]UploadStatus `json:"upload_statuses,omitempty"`
}
// ImageStatusValue defines model for ImageStatusValue.
type ImageStatusValue string
// ImageTypes defines model for ImageTypes.
type ImageTypes string
// ImportKeys defines model for ImportKeys.
type ImportKeys struct {
Files *[]string `json:"files,omitempty"`
}
// Installer defines model for Installer.
type Installer struct {
SudoNopasswd *[]string `json:"sudo-nopasswd,omitempty"`
Unattended *bool `json:"unattended,omitempty"`
}
// Kernel defines model for Kernel.
type Kernel struct {
// Appends arguments to the bootloader kernel command line
Append *string `json:"append,omitempty"`
// Name of the kernel to use
Name *string `json:"name,omitempty"`
}
// Koji defines model for Koji.
type Koji struct {
Name string `json:"name"`
Release string `json:"release"`
Server string `json:"server"`
TaskId int `json:"task_id"`
Version string `json:"version"`
}
// KojiLogs defines model for KojiLogs.
type KojiLogs struct {
Import interface{} `json:"import"`
Init interface{} `json:"init"`
}
// KojiStatus defines model for KojiStatus.
type KojiStatus struct {
BuildId *int `json:"build_id,omitempty"`
}
// List defines model for List.
type List struct {
Kind string `json:"kind"`
Page int `json:"page"`
Size int `json:"size"`
Total int `json:"total"`
}
// LocalUploadOptions defines model for LocalUploadOptions.
type LocalUploadOptions map[string]interface{}
// LocalUploadStatus defines model for LocalUploadStatus.
type LocalUploadStatus struct {
ArtifactPath string `json:"artifact_path"`
}
// Locale configuration
type Locale struct {
// Sets the keyboard layout
Keyboard *string `json:"keyboard,omitempty"`
// List of locales to be installed, the first one becomes primary, subsequent ones are secondary
Languages *[]string `json:"languages,omitempty"`
}
// Module defines model for Module.
type Module struct {
// Name of the module to enable.
Name string `json:"name"`
// Stream to enable.
Stream string `json:"stream"`
}
// OCIUploadOptions defines model for OCIUploadOptions.
type OCIUploadOptions map[string]interface{}
// OCIUploadStatus defines model for OCIUploadStatus.
type OCIUploadStatus struct {
Url string `json:"url"`
}
// OSTree defines model for OSTree.
type OSTree struct {
// A URL which, if set, is used for fetching content. Implies that `url` is set as well,
// which will be used for metadata only.
Contenturl *string `json:"contenturl,omitempty"`
// Can be either a commit (example: 02604b2da6e954bd34b8b82a835e5a77d2b60ffa), or a branch-like reference (example: rhel/8/x86_64/edge)
Parent *string `json:"parent,omitempty"`
Ref *string `json:"ref,omitempty"`
// Determines whether a valid subscription manager (candlepin) identity is required to
// access this repository. Consumer certificates will be used as client certificates when
// fetching metadata and content.
Rhsm *bool `json:"rhsm,omitempty"`
Url *string `json:"url,omitempty"`
}
// ObjectReference defines model for ObjectReference.
type ObjectReference struct {
Href string `json:"href"`
Id string `json:"id"`
Kind string `json:"kind"`
}
// OpenSCAP defines model for OpenSCAP.
type OpenSCAP struct {
JsonTailoring *OpenSCAPJSONTailoring `json:"json_tailoring,omitempty"`
// Puts a specified policy ID in the RHSM facts, so that any instances registered to
// insights will be automatically connected to the compliance policy in the console.
PolicyId *string `json:"policy_id,omitempty"`
ProfileId string `json:"profile_id"`
Tailoring *OpenSCAPTailoring `json:"tailoring,omitempty"`
}
// OpenSCAPJSONTailoring defines model for OpenSCAPJSONTailoring.
type OpenSCAPJSONTailoring struct {
Filepath string `json:"filepath"`
ProfileId string `json:"profile_id"`
}
// OpenSCAPTailoring defines model for OpenSCAPTailoring.
type OpenSCAPTailoring struct {
Selected *[]string `json:"selected,omitempty"`
Unselected *[]string `json:"unselected,omitempty"`
}
// Package defines model for Package.
type Package struct {
// Name of the package to install. File globbing is supported,
// eg. 'openssh-*'
Name string `json:"name"`
// Optional version of the package to install. If left blank the
// latest available version will be used. Wildcards are supported
// eg. '4.11.*'
Version *string `json:"version,omitempty"`
}
// PackageDetails defines model for PackageDetails.
type PackageDetails struct {
Arch string `json:"arch"`
Buildtime *string `json:"buildtime,omitempty"`
Description *string `json:"description,omitempty"`
Epoch *string `json:"epoch,omitempty"`
License *string `json:"license,omitempty"`
Name string `json:"name"`
Release string `json:"release"`
Summary *string `json:"summary,omitempty"`
Url *string `json:"url,omitempty"`
Version string `json:"version"`
}
// PackageGroup defines model for PackageGroup.
type PackageGroup struct {
// Package group name
Name string `json:"name"`
}
// PackageMetadata defines model for PackageMetadata.
type PackageMetadata struct {
// Embedded struct due to allOf(#/components/schemas/PackageMetadataCommon)
PackageMetadataCommon `yaml:",inline"`
// Embedded fields due to inline allOf schema
Sigmd5 string `json:"sigmd5"`
}
// PackageMetadataCommon defines model for PackageMetadataCommon.
type PackageMetadataCommon struct {
Arch string `json:"arch"`
// Optional package checksum using ALGO:HASH form
Checksum *string `json:"checksum,omitempty"`
Epoch *string `json:"epoch,omitempty"`
Name string `json:"name"`
Release string `json:"release"`
Signature *string `json:"signature,omitempty"`
Type string `json:"type"`
Version string `json:"version"`
}
// PulpOSTreeUploadOptions defines model for PulpOSTreeUploadOptions.
type PulpOSTreeUploadOptions struct {
// Basepath for distributing the repository
Basepath string `json:"basepath"`
// Repository to import the ostree commit to
Repository *string `json:"repository,omitempty"`
ServerAddress *string `json:"server_address,omitempty"`
}
// PulpOSTreeUploadStatus defines model for PulpOSTreeUploadStatus.
type PulpOSTreeUploadStatus struct {
RepoUrl string `json:"repo_url"`
}
// RHSMConfig defines model for RHSMConfig.
type RHSMConfig struct {
DnfPlugins *SubManDNFPluginsConfig `json:"dnf_plugins,omitempty"`
SubscriptionManager *SubManConfig `json:"subscription_manager,omitempty"`
}
// RHSMCustomization defines model for RHSMCustomization.
type RHSMCustomization struct {
Config *RHSMConfig `json:"config,omitempty"`
}
// RPMCustomization defines model for RPMCustomization.
type RPMCustomization struct {
ImportKeys *ImportKeys `json:"import_keys,omitempty"`
}
// Repository configuration.
// At least one of the 'baseurl', 'mirrorlist', 'metalink' properties must
// be specified. If more of them are specified, the order of precedence is
// the same as listed above.
type Repository struct {
Baseurl *string `json:"baseurl,omitempty"`
CheckGpg *bool `json:"check_gpg,omitempty"`
// Enables gpg verification of the repository metadata
CheckRepoGpg *bool `json:"check_repo_gpg,omitempty"`
// GPG key used to sign packages in this repository.
Gpgkey *string `json:"gpgkey,omitempty"`
IgnoreSsl *bool `json:"ignore_ssl,omitempty"`
Metalink *string `json:"metalink,omitempty"`
Mirrorlist *string `json:"mirrorlist,omitempty"`
// Disables modularity filtering for this repository.
ModuleHotfixes *bool `json:"module_hotfixes,omitempty"`
// Naming package sets for a repository assigns it to a specific part
// (pipeline) of the build process.
PackageSets *[]string `json:"package_sets,omitempty"`
// Determines whether a valid subscription is required to access this repository.
Rhsm *bool `json:"rhsm,omitempty"`
}
// SSHKey defines model for SSHKey.
type SSHKey struct {
// Adds the key to the user's authorized_keys file
Key string `json:"key"`
// User to configure the ssh key for
User string `json:"user"`
}
// SearchPackagesRequest defines model for SearchPackagesRequest.
type SearchPackagesRequest struct {
Architecture string `json:"architecture"`
Distribution string `json:"distribution"`
// Array of package names to search for. Supports * wildcards for
// names, but not for versions.
Packages []string `json:"packages"`
Repositories *[]Repository `json:"repositories,omitempty"`
}
// SearchPackagesResponse defines model for SearchPackagesResponse.
type SearchPackagesResponse struct {
// Detailed package information from DNF
Packages []PackageDetails `json:"packages"`
}
// Services defines model for Services.
type Services struct {
// List of services to disable by default
Disabled *[]string `json:"disabled,omitempty"`
// List of services to enable by default
Enabled *[]string `json:"enabled,omitempty"`
// List of services to mask by default
Masked *[]string `json:"masked,omitempty"`
}
// SubManConfig defines model for SubManConfig.
type SubManConfig struct {
Rhsm *SubManRHSMConfig `json:"rhsm,omitempty"`
Rhsmcertd *SubManRHSMCertdConfig `json:"rhsmcertd,omitempty"`
}
// SubManDNFPluginsConfig defines model for SubManDNFPluginsConfig.
type SubManDNFPluginsConfig struct {
ProductId *DNFPluginConfig `json:"product_id,omitempty"`
SubscriptionManager *DNFPluginConfig `json:"subscription_manager,omitempty"`
}
// SubManRHSMCertdConfig defines model for SubManRHSMCertdConfig.
type SubManRHSMCertdConfig struct {
AutoRegistration *bool `json:"auto_registration,omitempty"`
}
// SubManRHSMConfig defines model for SubManRHSMConfig.
type SubManRHSMConfig struct {
ManageRepos *bool `json:"manage_repos,omitempty"`
}
// Subscription defines model for Subscription.
type Subscription struct {
ActivationKey string `json:"activation_key"`
BaseUrl string `json:"base_url"`
Insights bool `json:"insights"`
Organization string `json:"organization"`
// Optional flag to use rhc to register the system, which also always enables Insights.
Rhc *bool `json:"rhc,omitempty"`
ServerUrl string `json:"server_url"`
}
// Timezone configuration
type Timezone struct {
// List of ntp servers
Ntpservers *[]string `json:"ntpservers,omitempty"`
// Name of the timezone, defaults to UTC
Timezone *string `json:"timezone,omitempty"`
}
// Options for a given upload destination.
// This should really be oneOf but AWSS3UploadOptions is a subset of
// AWSEC2UploadOptions. This means that all AWSEC2UploadOptions objects
// are also valid AWSS3UploadOptionas objects which violates the oneOf
// rules. Therefore, we have to use anyOf here but be aware that it isn't
// possible to mix and match more schemas together.
type UploadOptions interface{}
// UploadStatus defines model for UploadStatus.
type UploadStatus struct {
Options interface{} `json:"options"`
Status UploadStatusValue `json:"status"`
Type UploadTypes `json:"type"`
}
// UploadStatusValue defines model for UploadStatusValue.
type UploadStatusValue string
// UploadTarget defines model for UploadTarget.
type UploadTarget struct {
Type UploadTypes `json:"type"`
// Options for a given upload destination.
// This should really be oneOf but AWSS3UploadOptions is a subset of
// AWSEC2UploadOptions. This means that all AWSEC2UploadOptions objects
// are also valid AWSS3UploadOptionas objects which violates the oneOf
// rules. Therefore, we have to use anyOf here but be aware that it isn't
// possible to mix and match more schemas together.
UploadOptions UploadOptions `json:"upload_options"`
}
// UploadTypes defines model for UploadTypes.
type UploadTypes string
// User defines model for User.
type User struct {
Groups *[]string `json:"groups,omitempty"`
Key *string `json:"key,omitempty"`
Name string `json:"name"`
// If the password starts with $6$, $5$, or $2b$ it will be stored as
// an encrypted password. Otherwise it will be treated as a plain text
// password.
Password *string `json:"password,omitempty"`
}
// Page defines model for page.
type Page string
// Size defines model for size.
type Size string
// PostComposeJSONBody defines parameters for PostCompose.
type PostComposeJSONBody ComposeRequest
// PostCloneComposeJSONBody defines parameters for PostCloneCompose.
type PostCloneComposeJSONBody CloneComposeBody
// PostDepsolveBlueprintJSONBody defines parameters for PostDepsolveBlueprint.
type PostDepsolveBlueprintJSONBody DepsolveRequest
// GetErrorListParams defines parameters for GetErrorList.
type GetErrorListParams struct {
// Page index
Page *Page `json:"page,omitempty"`
// Number of items in each page
Size *Size `json:"size,omitempty"`
}
// PostSearchPackagesJSONBody defines parameters for PostSearchPackages.
type PostSearchPackagesJSONBody SearchPackagesRequest
// PostComposeJSONRequestBody defines body for PostCompose for application/json ContentType.
type PostComposeJSONRequestBody PostComposeJSONBody
// PostCloneComposeJSONRequestBody defines body for PostCloneCompose for application/json ContentType.
type PostCloneComposeJSONRequestBody PostCloneComposeJSONBody
// PostDepsolveBlueprintJSONRequestBody defines body for PostDepsolveBlueprint for application/json ContentType.
type PostDepsolveBlueprintJSONRequestBody PostDepsolveBlueprintJSONBody
// PostSearchPackagesJSONRequestBody defines body for PostSearchPackages for application/json ContentType.
type PostSearchPackagesJSONRequestBody PostSearchPackagesJSONBody
// Getter for additional properties for DistributionList_Map. Returns the specified
// element and whether it was found
func (a DistributionList_Map) Get(fieldName string) (value interface{}, found bool) {
if a.AdditionalProperties != nil {
value, found = a.AdditionalProperties[fieldName]
}
return
}
// Setter for additional properties for DistributionList_Map
func (a *DistributionList_Map) Set(fieldName string, value interface{}) {
if a.AdditionalProperties == nil {
a.AdditionalProperties = make(map[string]interface{})
}
a.AdditionalProperties[fieldName] = value
}
// Override default JSON handling for DistributionList_Map to handle AdditionalProperties
func (a *DistributionList_Map) UnmarshalJSON(b []byte) error {
object := make(map[string]json.RawMessage)
err := json.Unmarshal(b, &object)
if err != nil {
return err
}
if len(object) != 0 {
a.AdditionalProperties = make(map[string]interface{})
for fieldName, fieldBuf := range object {
var fieldVal interface{}
err := json.Unmarshal(fieldBuf, &fieldVal)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("error unmarshaling field %s", fieldName))
}
a.AdditionalProperties[fieldName] = fieldVal
}
}
return nil
}
// Override default JSON handling for DistributionList_Map to handle AdditionalProperties
func (a DistributionList_Map) MarshalJSON() ([]byte, error) {
var err error
object := make(map[string]json.RawMessage)
for fieldName, field := range a.AdditionalProperties {
object[fieldName], err = json.Marshal(field)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("error marshaling '%s'", fieldName))
}
}
return json.Marshal(object)
}
// ServerInterface represents all server handlers.
type ServerInterface interface {
// The status of a cloned compose
// (GET /clones/{id})
GetCloneStatus(ctx echo.Context, id string) error
// Create compose
// (POST /compose)
PostCompose(ctx echo.Context) error
// The list of composes
// (GET /composes/)
GetComposeList(ctx echo.Context) error
// The status of a compose
// (GET /composes/{id})
GetComposeStatus(ctx echo.Context, id string) error
// Clone an existing compose
// (POST /composes/{id}/clone)
PostCloneCompose(ctx echo.Context, id string) error
// Download the artifact for a compose.
// (GET /composes/{id}/download)
GetComposeDownload(ctx echo.Context, id string) error
// Get logs for a compose.
// (GET /composes/{id}/logs)
GetComposeLogs(ctx echo.Context, id string) error
// Get the manifests for a compose.
// (GET /composes/{id}/manifests)
GetComposeManifests(ctx echo.Context, id string) error
// Get the metadata for a compose.
// (GET /composes/{id}/metadata)
GetComposeMetadata(ctx echo.Context, id string) error
// Get the SBOMs for a compose.
// (GET /composes/{id}/sboms)
GetComposeSBOMs(ctx echo.Context, id string) error
// Depsolve one or more blueprints
// (POST /depsolve/blueprint)
PostDepsolveBlueprint(ctx echo.Context) error
// Get all of the supported distribution repository details
// (GET /distributions)
GetDistributionList(ctx echo.Context) error
// Get a list of all possible errors
// (GET /errors)
GetErrorList(ctx echo.Context, params GetErrorListParams) error
// Get error description
// (GET /errors/{id})
GetError(ctx echo.Context, id string) error
// Get the openapi spec in json format
// (GET /openapi)
GetOpenapi(ctx echo.Context) error
// Search for detailed information on a list of package names
// (POST /search/packages)
PostSearchPackages(ctx echo.Context) error
}
// ServerInterfaceWrapper converts echo contexts to parameters.
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
// GetCloneStatus converts echo context to params.
func (w *ServerInterfaceWrapper) GetCloneStatus(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetCloneStatus(ctx, id)
return err
}
// PostCompose converts echo context to params.
func (w *ServerInterfaceWrapper) PostCompose(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.PostCompose(ctx)
return err
}
// GetComposeList converts echo context to params.
func (w *ServerInterfaceWrapper) GetComposeList(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetComposeList(ctx)
return err
}
// GetComposeStatus converts echo context to params.
func (w *ServerInterfaceWrapper) GetComposeStatus(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetComposeStatus(ctx, id)
return err
}
// PostCloneCompose converts echo context to params.
func (w *ServerInterfaceWrapper) PostCloneCompose(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.PostCloneCompose(ctx, id)
return err
}
// GetComposeDownload converts echo context to params.
func (w *ServerInterfaceWrapper) GetComposeDownload(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetComposeDownload(ctx, id)
return err
}
// GetComposeLogs converts echo context to params.
func (w *ServerInterfaceWrapper) GetComposeLogs(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetComposeLogs(ctx, id)
return err
}
// GetComposeManifests converts echo context to params.
func (w *ServerInterfaceWrapper) GetComposeManifests(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetComposeManifests(ctx, id)
return err
}
// GetComposeMetadata converts echo context to params.
func (w *ServerInterfaceWrapper) GetComposeMetadata(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetComposeMetadata(ctx, id)
return err
}
// GetComposeSBOMs converts echo context to params.
func (w *ServerInterfaceWrapper) GetComposeSBOMs(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetComposeSBOMs(ctx, id)
return err
}
// PostDepsolveBlueprint converts echo context to params.
func (w *ServerInterfaceWrapper) PostDepsolveBlueprint(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.PostDepsolveBlueprint(ctx)
return err
}
// GetDistributionList converts echo context to params.
func (w *ServerInterfaceWrapper) GetDistributionList(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetDistributionList(ctx)
return err
}
// GetErrorList converts echo context to params.
func (w *ServerInterfaceWrapper) GetErrorList(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params GetErrorListParams
// ------------- Optional query parameter "page" -------------
err = runtime.BindQueryParameter("form", true, false, "page", ctx.QueryParams(), &params.Page)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter page: %s", err))
}
// ------------- Optional query parameter "size" -------------
err = runtime.BindQueryParameter("form", true, false, "size", ctx.QueryParams(), &params.Size)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter size: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetErrorList(ctx, params)
return err
}
// GetError converts echo context to params.
func (w *ServerInterfaceWrapper) GetError(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id string
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetError(ctx, id)
return err
}
// GetOpenapi converts echo context to params.
func (w *ServerInterfaceWrapper) GetOpenapi(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetOpenapi(ctx)
return err
}
// PostSearchPackages converts echo context to params.
func (w *ServerInterfaceWrapper) PostSearchPackages(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.PostSearchPackages(ctx)
return err
}
// This is a simple interface which specifies echo.Route addition functions which
// are present on both echo.Echo and echo.Group, since we want to allow using
// either of them for path registration
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
// RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlers(router EchoRouter, si ServerInterface) {
RegisterHandlersWithBaseURL(router, si, "")
}
// Registers handlers, and prepends BaseURL to the paths, so that the paths
// can be served under a prefix.
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) {
wrapper := ServerInterfaceWrapper{
Handler: si,
}
router.GET(baseURL+"/clones/:id", wrapper.GetCloneStatus)
router.POST(baseURL+"/compose", wrapper.PostCompose)
router.GET(baseURL+"/composes/", wrapper.GetComposeList)
router.GET(baseURL+"/composes/:id", wrapper.GetComposeStatus)
router.POST(baseURL+"/composes/:id/clone", wrapper.PostCloneCompose)
router.GET(baseURL+"/composes/:id/download", wrapper.GetComposeDownload)
router.GET(baseURL+"/composes/:id/logs", wrapper.GetComposeLogs)
router.GET(baseURL+"/composes/:id/manifests", wrapper.GetComposeManifests)
router.GET(baseURL+"/composes/:id/metadata", wrapper.GetComposeMetadata)
router.GET(baseURL+"/composes/:id/sboms", wrapper.GetComposeSBOMs)
router.POST(baseURL+"/depsolve/blueprint", wrapper.PostDepsolveBlueprint)
router.GET(baseURL+"/distributions", wrapper.GetDistributionList)
router.GET(baseURL+"/errors", wrapper.GetErrorList)
router.GET(baseURL+"/errors/:id", wrapper.GetError)
router.GET(baseURL+"/openapi", wrapper.GetOpenapi)
router.POST(baseURL+"/search/packages", wrapper.PostSearchPackages)
}
// Base64 encoded, gzipped, json marshaled Swagger object
var swaggerSpec = []string{
"H4sIAAAAAAAC/+x9eXPbOPLoV0HppSqTF923XTX1e7J8ybZ8yUfsVcoLkZAEiwQYAJQszy/f/RUOUqRE",
"XXEyu9n1H7sTizgaDXSjb/yVsqjrUYKI4Kndv1IeZNBFAjHz1wDJ/9qIWwx7AlOS2k1dwgECmNjoJZVO",
"oRfoeg6KNR9Dx0ep3VQh9f17OoVln28+YtNUOkWgK7+olukUt4bIhbKLmHrydy4YJgPVjePXhLnPfbeH",
"GKB9gAVyOcAEIGgNgRkwCk0wQAhNPr8UHtV2FTzfg49q6MZ956BZbDqUoKZEH1cTQdvGEkzoXDLqISaw",
"BKQPHY7SKS/y018phgZqPQsTpVN8CBl6mmAxfIKWRX2zMWZlqd1/pArFUrlSrdV38oVi6ms6pTCROJb5",
"ATIGp2rtDH3zMUO2HMbA8DVsRnvPyBKyn17fredQaF8o1PMfXmAIeAr5mQniIlNIpf/OZadTnECPD6l4",
"0rsdhcmdZoKvi1AlIywZ1nVo7AgofE0lMURBF8chgi7O5K16KV/bKdVqlcpOxS73kjC2JYrnFiPnTa85",
"A53SW46A5/ccbGkS7kPfEWG7OEm3+oAjAQQF6jP4QwwRMF2AIt5PaQCBQ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",
"hQT3ERfraSlsuQE5XSPhM8JVen3QTwGjrPNG/CKGVJQ8al4zCBtbVBFWWOfXbF/wmgMUIOqoNcX5dbIa",
"JDnzdyYYLltZQYrtEAXv9LiWHmfIWiaYRLd7U8HkN6e1OHlsQHSRokOraS6sQpkoZeuH9NCLvDGjFxFT",
"5IdsYCNdNpvGaC0MClDPoKyijADOd8JYTxgBrt4F9neB/T9ZYF/gTev5He9Rd7mAEQgLEOio6vhzKHyN",
"3NAlc80hC9uol1Nmj7csdRHsXbS3vPwlTDoUW7M5EIzxX+IqUKtdwunUx/+263+26HlSsJHHqTNGuZ7j",
"I4+ZN+qXm5n3Tfu9sPmvMdoG82wVm5L/BdMvt9cGbWb5wqpwxN99VQY7+B6msnhh/jZmpmAPVcU3pnNZ",
"Qoo0Lu1oAnz0vlq4OPYjDX91fMfCXEmEEmkDYhUDfjPBAjpO+NxbUC8Y2ImrmwI7yPyXe6dmXblpCnaz",
"W3NXfdKSZ01y6hmTZek0kXbqnZNfev/O1pDELsJIDYOMdz71rxHsNQX8fmI9DA+QpMMwETA4TTMyWx/z",
"A0lYkj8gaA3ZrLZ/bwqU/JpMqJt72JFp/ibRu/Q3C9JLt1J9ANHf3qn4nYq3oWK0eIIk5YYJR8tvyAvT",
"5I3nfj4XbGGhBhTFC6SuLocwevrvaAlZuRyJel00Kheti7Rc/4tXWfpFyl9yma6/WQVcUk8qYbN0SxBA",
"ovMkA53QnhWA+lvVQh4A9a4U/qZKYScs5mYOEbJjfhRKIiJRrBScBiisp7IgnbQhJuAPU5QJU/IJhI9S",
"xtNMoYez6l2XIe7rEj/Qwzn9+K3yYSKWMfYklhsXlRYy/6AcHGAyWDUBF3CA3jiNpR+lBjZ1oSoTqKdZ",
"N87X7/8/AAD//86RvuTV6AAA",
}
// GetSwagger returns the content of the embedded swagger specification file
// or error if failed to decode
func decodeSpec() ([]byte, error) {
zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, ""))
if err != nil {
return nil, fmt.Errorf("error base64 decoding spec: %s", err)
}
zr, err := gzip.NewReader(bytes.NewReader(zipped))
if err != nil {
return nil, fmt.Errorf("error decompressing spec: %s", err)
}
var buf bytes.Buffer
_, err = buf.ReadFrom(zr)
if err != nil {
return nil, fmt.Errorf("error decompressing spec: %s", err)
}
return buf.Bytes(), nil
}
var rawSpec = decodeSpecCached()
// a naive cached of a decoded swagger spec
func decodeSpecCached() func() ([]byte, error) {
data, err := decodeSpec()
return func() ([]byte, error) {
return data, err
}
}
// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
var res = make(map[string]func() ([]byte, error))
if len(pathToFile) > 0 {
res[pathToFile] = rawSpec
}
return res
}
// GetSwagger returns the Swagger specification corresponding to the generated code
// in this file. The external references of Swagger specification are resolved.
// The logic of resolving external references is tightly connected to "import-mapping" feature.
// Externally referenced files must be embedded in the corresponding golang packages.
// Urls can be supported but this task was out of the scope.
func GetSwagger() (swagger *openapi3.T, err error) {
var resolvePath = PathToRawSpec("")
loader := openapi3.NewLoader()
loader.IsExternalRefsAllowed = true
loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
var pathToFile = url.String()
pathToFile = path.Clean(pathToFile)
getSpec, ok := resolvePath[pathToFile]
if !ok {
err1 := fmt.Errorf("path not found: %s", pathToFile)
return nil, err1
}
return getSpec()
}
var specData []byte
specData, err = rawSpec()
if err != nil {
return
}
swagger, err = loader.LoadFromData(specData)
if err != nil {
return
}
return
}