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

47 lines
1014 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.

//
// Organizations.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 Organization {
public enum Resources { }
}
extension Organization.Resources {
/// List organizations
///
/// Returns a paginated list of the users organizations.
public struct List: Resource, HasResponseBody, Paginated {
public typealias Content = [Organization]
public let path = "organizations"
public init() {
}
}
/// Get an organization
public struct Get: Resource, HasResponseBody {
public typealias Content = Organization
/// organization slug
public var organization: String
public var path: String {
"organizations/\(organization)"
}
public init(organization: String) {
self.organization = organization
}
}
}