tapsandswipes / BarbershopTagsAPIClient

Swift client to access barbershoptags.com API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BarbershopTagsAPIClient

GitHub license Language Swift Package Manager

Swift library to make calls to barbershoptags.com public API.

Usage

First, create a client instance with a name to identify yourseft to the server:

let client = BarbershopTagsAPIClient(name: "myApp")

then perfom a query with the getTags method:

let query = Query(term: "love you")
let response = ResponseInfo(resultFields: [.title, ])
let result = try await client.getTags(query: query, respone: response)

print("Number of tags matching query: \(result.available)")
for tag in result.tags {
    print("Tag id: \(tag.id)")
    print("Tag title: \(tag.title)")
}

See documentation for more options.

Instalation

You can use the Swift Package Manager by declaring BarbershopTagsAPIClient as a dependency in your Package.swift file:

.package(url: "https://github.com/tapsandswipes/BarbershopTagsAPIClient", from: "1.0.0")

For more information, see the Swift Package Manager documentation.

Contact

If you use/enjoy BarbershopTagsAPIClient, let me know!

License

MIT License

Copyright (c) 2024 Antonio Cabezuelo Vivo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Swift client to access barbershoptags.com API


Languages

Language:Swift 100.0%