47 lines
1014 B
Swift
47 lines
1014 B
Swift
//
|
||
// 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 user’s 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
|
||
}
|
||
}
|
||
|
||
}
|