buildkite-swift/Sources/Buildkite/Resources/Annotations.swift

38 lines
928 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Annotations.swift
//
//
// Created by Aaron Sky on 4/21/20.
//
import Foundation
extension Annotation {
public enum Resources { }
}
extension Annotation.Resources {
/// List annotations for a build
///
/// Returns a paginated list of a builds annotations.
public struct List: Resource, HasResponseBody {
public typealias Content = [Annotation]
/// organization slug
public var organization: String
/// pipeline slug
public var pipeline: String
/// build number
public var build: Int
public var path: String {
"organizations/\(organization)/pipelines/\(pipeline)/builds/\(build)/annotations"
}
public init(organization: String, pipeline: String, build: Int) {
self.organization = organization
self.pipeline = pipeline
self.build = build
}
}
}