| 1 |
// Copyright 2024 The Archivista Contributors |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
package rstuf |
| 16 |
|
| 17 |
// Hashes represents the Hashes structure |
| 18 |
type Hashes struct { |
| 19 |
Sha256 string `json:"sha256"` |
| 20 |
} |
| 21 |
|
| 22 |
// ArtifactInfo represents the ArtifactInfo structure |
| 23 |
type ArtifactInfo struct { |
| 24 |
Length int `json:"length"` |
| 25 |
Hashes Hashes `json:"hashes"` |
| 26 |
Custom map[string]any `json:"custom,omitempty"` |
| 27 |
} |
| 28 |
|
| 29 |
// Artifact represents the Artifact structure |
| 30 |
type Artifact struct { |
| 31 |
Path string `json:"path"` |
| 32 |
Info ArtifactInfo `json:"info"` |
| 33 |
} |
| 34 |
|
| 35 |
// ArtifactPayload represents the payload structure |
| 36 |
type ArtifactPayload struct { |
| 37 |
Artifacts []Artifact `json:"artifacts"` |
| 38 |
AddTaskIDToCustom bool `json:"add_task_id_to_custom"` |
| 39 |
PublishTargets bool `json:"publish_targets"` |
| 40 |
} |
| 41 |
|
| 42 |
type ArtifactsResponse struct { |
| 43 |
Artifacts []string `json:"artifacts"` |
| 44 |
TaskId string `json:"task_id"` |
| 45 |
LastUpdate string `json:"last_update"` |
| 46 |
Message string `json:"message"` |
| 47 |
} |
| 48 |
|
| 49 |
type Response struct { |
| 50 |
Data ArtifactsResponse `json:"data"` |
| 51 |
} |