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

43 lines
1.0 KiB
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
// Buildkite
//
// Created by Aaron Sky on 4/21/20.
// Copyright © 2020 Aaron Sky. All rights reserved.
//
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
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, Paginated {
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
}
}
}