// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/swift-aws/aws-sdk-swift/blob/master/CodeGenerator/Sources/CodeGenerator/main.swift. DO NOT EDIT.

@_exported import AWSSDKSwiftCore
import Foundation
import NIO

/**
This is the API reference for AWS Data Exchange.
*/
public struct DataExchange {

    public let client: AWSClient

    public init(accessKeyId: String? = nil, secretAccessKey: String? = nil, sessionToken: String? = nil, region: AWSSDKSwiftCore.Region? = nil, endpoint: String? = nil, middlewares: [AWSServiceMiddleware] = [], eventLoopGroupProvider: AWSClient.EventLoopGroupProvider = .useAWSClientShared) {
        self.client = AWSClient(
            accessKeyId: accessKeyId,
            secretAccessKey: secretAccessKey,
            sessionToken: sessionToken,
            region: region,
            service: "dataexchange",
            serviceProtocol: ServiceProtocol(type: .restjson, version: ServiceProtocol.Version(major: 1, minor: 1)),
            apiVersion: "2017-07-25",
            endpoint: endpoint,
            middlewares: middlewares,
            possibleErrorTypes: [DataExchangeErrorType.self],
            eventLoopGroupProvider: eventLoopGroupProvider
        )
    }

    ///  This operation cancels a job. Jobs can be cancelled only when they are in the WAITING state.
    @discardableResult public func cancelJob(_ input: CancelJobRequest) -> Future<Void> {
        return client.send(operation: "CancelJob", path: "/v1/jobs/{JobId}", httpMethod: "DELETE", input: input)
    }

    ///  This operation creates a data set.
    public func createDataSet(_ input: CreateDataSetRequest) -> Future<CreateDataSetResponse> {
        return client.send(operation: "CreateDataSet", path: "/v1/data-sets", httpMethod: "POST", input: input)
    }

    ///  This operation creates a job.
    public func createJob(_ input: CreateJobRequest) -> Future<CreateJobResponse> {
        return client.send(operation: "CreateJob", path: "/v1/jobs", httpMethod: "POST", input: input)
    }

    ///  This operation creates a revision for a data set.
    public func createRevision(_ input: CreateRevisionRequest) -> Future<CreateRevisionResponse> {
        return client.send(operation: "CreateRevision", path: "/v1/data-sets/{DataSetId}/revisions", httpMethod: "POST", input: input)
    }

    ///  This operation deletes an asset.
    @discardableResult public func deleteAsset(_ input: DeleteAssetRequest) -> Future<Void> {
        return client.send(operation: "DeleteAsset", path: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}", httpMethod: "DELETE", input: input)
    }

    ///  This operation deletes a data set.
    @discardableResult public func deleteDataSet(_ input: DeleteDataSetRequest) -> Future<Void> {
        return client.send(operation: "DeleteDataSet", path: "/v1/data-sets/{DataSetId}", httpMethod: "DELETE", input: input)
    }

    ///  This operation deletes a revision.
    @discardableResult public func deleteRevision(_ input: DeleteRevisionRequest) -> Future<Void> {
        return client.send(operation: "DeleteRevision", path: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}", httpMethod: "DELETE", input: input)
    }

    ///  This operation returns information about an asset.
    public func getAsset(_ input: GetAssetRequest) -> Future<GetAssetResponse> {
        return client.send(operation: "GetAsset", path: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}", httpMethod: "GET", input: input)
    }

    ///  This operation returns information about a data set.
    public func getDataSet(_ input: GetDataSetRequest) -> Future<GetDataSetResponse> {
        return client.send(operation: "GetDataSet", path: "/v1/data-sets/{DataSetId}", httpMethod: "GET", input: input)
    }

    ///  This operation returns information about a job.
    public func getJob(_ input: GetJobRequest) -> Future<GetJobResponse> {
        return client.send(operation: "GetJob", path: "/v1/jobs/{JobId}", httpMethod: "GET", input: input)
    }

    ///  This operation returns information about a revision.
    public func getRevision(_ input: GetRevisionRequest) -> Future<GetRevisionResponse> {
        return client.send(operation: "GetRevision", path: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}", httpMethod: "GET", input: input)
    }

    ///  This operation lists a data set's revisions sorted by CreatedAt in descending order.
    public func listDataSetRevisions(_ input: ListDataSetRevisionsRequest) -> Future<ListDataSetRevisionsResponse> {
        return client.send(operation: "ListDataSetRevisions", path: "/v1/data-sets/{DataSetId}/revisions", httpMethod: "GET", input: input)
    }

    ///  This operation lists your data sets. When listing by origin OWNED, results are sorted by CreatedAt in descending order. When listing by origin ENTITLED, there is no order and the maxResults parameter is ignored.
    public func listDataSets(_ input: ListDataSetsRequest) -> Future<ListDataSetsResponse> {
        return client.send(operation: "ListDataSets", path: "/v1/data-sets", httpMethod: "GET", input: input)
    }

    ///  This operation lists your jobs sorted by CreatedAt in descending order.
    public func listJobs(_ input: ListJobsRequest) -> Future<ListJobsResponse> {
        return client.send(operation: "ListJobs", path: "/v1/jobs", httpMethod: "GET", input: input)
    }

    ///  This operation lists a revision's assets sorted alphabetically in descending order.
    public func listRevisionAssets(_ input: ListRevisionAssetsRequest) -> Future<ListRevisionAssetsResponse> {
        return client.send(operation: "ListRevisionAssets", path: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets", httpMethod: "GET", input: input)
    }

    ///  This operation lists the tags on the resource.
    public func listTagsForResource(_ input: ListTagsForResourceRequest) -> Future<ListTagsForResourceResponse> {
        return client.send(operation: "ListTagsForResource", path: "/tags/{resource-arn}", httpMethod: "GET", input: input)
    }

    ///  This operation starts a job.
    public func startJob(_ input: StartJobRequest) -> Future<StartJobResponse> {
        return client.send(operation: "StartJob", path: "/v1/jobs/{JobId}", httpMethod: "PATCH", input: input)
    }

    ///  This operation tags a resource.
    @discardableResult public func tagResource(_ input: TagResourceRequest) -> Future<Void> {
        return client.send(operation: "TagResource", path: "/tags/{resource-arn}", httpMethod: "POST", input: input)
    }

    ///  This operation removes one or more tags from a resource.
    @discardableResult public func untagResource(_ input: UntagResourceRequest) -> Future<Void> {
        return client.send(operation: "UntagResource", path: "/tags/{resource-arn}", httpMethod: "DELETE", input: input)
    }

    ///  This operation updates an asset.
    public func updateAsset(_ input: UpdateAssetRequest) -> Future<UpdateAssetResponse> {
        return client.send(operation: "UpdateAsset", path: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}", httpMethod: "PATCH", input: input)
    }

    ///  This operation updates a data set.
    public func updateDataSet(_ input: UpdateDataSetRequest) -> Future<UpdateDataSetResponse> {
        return client.send(operation: "UpdateDataSet", path: "/v1/data-sets/{DataSetId}", httpMethod: "PATCH", input: input)
    }

    ///  This operation updates a revision.
    public func updateRevision(_ input: UpdateRevisionRequest) -> Future<UpdateRevisionResponse> {
        return client.send(operation: "UpdateRevision", path: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}", httpMethod: "PATCH", input: input)
    }
}
