debian-forge-composer/internal/cloudapi/v2/openapi.v2.gen.go
Brian C. Lane c0bf89b51f openapi: Add ComposeRequest as part of the ComposeMetadata response
This will allow clients to display more information about a compose,
including the image type created, arch and distro, and blueprint to
customizations used to create it.

Related: RHEL-60120
2025-03-05 12:36:36 +01:00

2008 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"`
// 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"`
// 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 []PackageMetadata `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"`
}
// 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 {
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"`
Sigmd5 *string `json:"sigmd5,omitempty"`
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/+x9eXPbOLL4V0HpN1WZvOi+7aqpfbJ8ybZ8yUfsVcoLkZAEiwQYAJQsz8t3/xUOUqRE",
"XXEys9n1H7sTizgaDXSjb/yZsqjrUYKI4KndP1MeZNBFAjHz1wDJ/9qIWwx7AlOS2k1dwgECmNjoJZVO",
"oRfoeg6KNR9Dx0ep3VQh9e1bOoVln68+YtNUOkWgK7+olukUt4bIhbKLmHrydy4YJgPVjePXhLnPfbeH",
"GKB9gAVyOcAEIGgNgRkwCk0wQAhNPr8UHtV2FTzfgo9q6MZ956BZbDqUoKZEH1cTQdvGEkzoXDLqISaw",
"BKQPHY7SKS/y058phgZqPQsTpVN8CBl6mmAxfIKWRX2zMWZlqd1/pgrFUrlSrdV38oVi6ks6pTCROJb5",
"ATIGp2rtDH31MUO2HMbA8CVsRnvPyBKyn17fredQaF8o1PPvXmAIeAr5mQniIlNIpf/KZadTnECPD6l4",
"0rsdhcmdZoKvi1AlIywZ1nVo7AgofE0lMURBF8chgi7O5K16KV/bKdVqlcpOxS73kjC2JYrnFiPnTa85",
"A53SW46A5/ccbGkS7kPfEWG7OEm3+oAjAQQF6jP4XQwRMF2AIt6PaQCBQ8kgDWiv73MLCmSD2+uzLsEc",
"MCR8RpCdBS3BAXrxMINyaODiwVCAHgKcUoIYEENIQJ8yQMUQMeCrtXWJgGyABM92SZfMYBHMR3JaPqRM",
"ICZnA5HJACR2l+D4hJgDCTuHLgKQq6nk39HpwGy22Rb1KHUQJG/f1M22c9lR9JmTzIqjU8hGieO/+gy9",
"5bgMpx5iT+OnASJI4zN2dFJ3cvnxk9McUsqRwvFd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Wu0STqc+/rdd/7NFz5OCjTxOnTHK9Rwfecy8fb7czLxv2u+FzX+O0TaYZ6vYlPxPmH65",
"vTZoM8sXVoUj/uqrMtjB9zCVxQvzlzEzBXuoKr4xncsSUqRxaUcT4KP31cLFsR9p+LPjOxbmSiKUSBsQ",
"qxjwiwkW0HHCZ8SCqrzATlzdFNhB5r/cOzXryk1TsJvdmrvqk5Y8a5JTz2MsS6eJtFPvZ/zU+3e2hiR2",
"EUZqGGS886m/R7DXFPDrifUwPECSDsNEwOA0zchsfcwPJGHh+4CgNWSzCvq9KVDyazKhbu5hR6b5m0Tv",
"0l8sSC/dSvUBRH97p+J3Kt6GitHiCZKUGyYcLb8hL0yTN577+VywhYUaUBQvkLq6HMLo6b+iJWTlciTq",
"ddGoXLQu0nL9L15l6Scpf8lluv5iFXBJPamEzdItQQCJzpMMdEJ7VgDqL1ULeQDUu1L4iyqFnbCYmzlE",
"yI75USiJiESxUnAaoLCeyoJ00oaYgN9NUSZMyUcQPnYYTzOFHs6q11OGuK9L/EAP5/SjqsqHiVjG2JNY",
"blxUWsgcbQg4wGSwagIu4AC9cRpLP3YMbOpCVSZQT7NunC/f/n8AAAD//2B/lwmD5gAA",
}
// 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
}