{"id":15694051,"url":"https://github.com/tombuildsstuff/swiftcity","last_synced_at":"2025-05-08T06:05:57.029Z","repository":{"id":62456432,"uuid":"50728794","full_name":"tombuildsstuff/swiftcity","owner":"tombuildsstuff","description":"A TeamCity API Client written in Swift","archived":false,"fork":false,"pushed_at":"2016-09-10T01:40:42.000Z","size":100,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T06:05:40.684Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tombuildsstuff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-30T14:46:17.000Z","updated_at":"2022-09-20T13:58:37.000Z","dependencies_parsed_at":"2022-11-02T00:16:54.050Z","dependency_job_id":null,"html_url":"https://github.com/tombuildsstuff/swiftcity","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Fswiftcity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Fswiftcity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Fswiftcity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Fswiftcity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tombuildsstuff","download_url":"https://codeload.github.com/tombuildsstuff/swiftcity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253009905,"owners_count":21839717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T18:51:40.226Z","updated_at":"2025-05-08T06:05:56.980Z","avatar_url":"https://github.com/tombuildsstuff.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftCity\nA TeamCity API Client written in Swift\n\nThis is a _Work-In-Progress_ - with more endpoints coming soon.\nThis project is inspired by [TeamCitySharp](https://github.com/stack72/teamcitysharp).\n\n## Roadmap / To Do\n- [x] Read-Only Endpoints:\n  - [x] Builds\n  - [x] Build Agents\n  - [x] Build Agent Pools\n  - [x] Build Queue\n  - [x] Projects\n  - [x] Server Information\n  - [x] Users\n  - [x] User Groups\n  - [x] VCS Roots\n- [ ] Editable Endpoints\n  - [ ] Builds\n  - [ ] Build Agents\n  - [ ] Build Agent Pools\n  - [ ] Build Queue\n  - [ ] Projects\n  - [ ] Users\n  - [ ] User Groups\n  - [ ] VCS Roots\n- [ ] Proper Error Handling\n- [ ] Integration Tests\n- [ ] Swift Package Manager support\n- [x] Cocoapods support\n\n## Licence\n[MIT](http://tombuildsstuff.mit-license.org)\n\n## Contributing\nSend a pull request, ideally with tests :)\n\n## Installing\nWe're using Cocoapods - so just:\n```\npod 'SwiftCity', '0.1'\n```\n\n## Documentation\n_Be aware the TeamCity API provides fields based on permissions - so if you're not seeing a field which you expect, check this first.._\n\n### Open A Connection (as the Guest User)\n```\nlet connection = TeamCityConnection(server: \"http://teamcity-server.example.com\")\nlet client = TeamCityClient(connection: connection)\nclient.authenticate({ () -\u003e () in\n    print(\"Authenticated!\")\n}) { (error) -\u003e () in\n    print(\"Failed to Authenticate!\")\n}\n```\n\n### Open A Connection (as a named user)\n```\nlet connection = TeamCityConnection(server: \"http://teamcity-server.example.com\", username: \"username\", password: \"password\")\nlet client = TeamCityClient(connection: connection)\nclient.authenticate({ () -\u003e () in\n    print(\"Authenticated!\")\n}) { (error) -\u003e () in\n    print(\"Failed to Authenticate!\")\n}\n```\n\n### List All Projects\n```\nclient.allProjects({ (projects) -\u003e () in\n    print(\"Projects: \\(projects)\")\n}) { (error: NSError) -\u003e () in\n    print(\"Projects Error: \\(error)\")\n}\n```\n\n### Get Project By ID\n```\nclient.projectById(\"Example\", successful: { (project) -\u003e () in\n    print(\"Project: \\(project)\")\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### List All Build Configuration\n```\nclient.allBuildTypes({ (types: BuildTypes) -\u003e () in\n    print(types)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Build Configuration Details\n```\nclient.buildTypesById(\"Example_BuildConfig\", successful: { (type: BuildType) -\u003e () in\n    print(type)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### List the Build Queue\n```\nclient.buildQueue({ (queue: BuildQueue) -\u003e () in\n    print(queue.queue)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Retrieve the Server Information\n```\nclient.serverInformation({ (info: ServerInformation) -\u003e () in\n    print(info)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### List All VCS Roots\n```\nclient.allVcsRoots({ (roots: VCSRoots) -\u003e () in\n    print(roots)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Retrieve a VCS Root by ID\n```\nclient.vcsRootById(\"Puppet_Github\", successful: { (root: VCSRoot?) -\u003e () in\n    print(root)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### List All Users\n```\nclient.allUsers({ (users: Users) -\u003e () in\n    print(users)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Retrieve a User by Username\n```\nclient.userByName(\"example_api_user\", successful: { (user: User?) -\u003e () in\n    print(user)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Retrieve a User by ID\n```\nclient.userById(2, successful: { (user: User?) -\u003e () in\n    print(user)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### List All Groups\n```\nclient.allGroups({ (groups: Groups) -\u003e () in\n    print(groups)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Retrieve a Group by Key\n```\nclient.groupByKey(\"MIDDLE_GROUP\", successful: { (group: Group?) -\u003e () in\n    print(group)\n}) { (error:NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### List All Build Agents\n```\nclient.allBuildAgents({ (agents: BuildAgents) -\u003e () in\n    print(agents)\n}) { (error:NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Retrieve a Build Agent by ID\n```\nclient.buildAgentById(1, successful: { (agent: BuildAgent?) -\u003e () in\n    print(agent)\n}) { (error:NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Retrieve a Build Agent by Name\n```\nclient.buildAgentByName(\"tc-buildagent-01\", successful: { (agent: BuildAgent?) -\u003e () in\n    print(agent)\n}) { (error:NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### List All Build Agent Pools\n```\nclient.allBuildAgentPools({ (pools: BuildAgentPools) -\u003e () in\n    print(pools)\n}) { (error: NSError) -\u003e () in\n    print(error)\n}\n```\n\n### Retrieve a Build Agent Pool by ID\n```\nclient.buildAgentPoolById(1, successful: { (agent: BuildAgentPool?) -\u003e () in\n    print(agent)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### List All Builds\n```\nlet start = 10\nlet count = 10\nclient.allBuilds(start, count: count, successful: { (builds: Builds) -\u003e () in\n    print(builds)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n### Retrieve a Build by ID\n```\nclient.buildById(1561, successful: { (build: Build?) -\u003e () in\n    print(build)\n}) { (error: NSError) -\u003e () in\n    print(\"Error: \\(error)\")\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombuildsstuff%2Fswiftcity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftombuildsstuff%2Fswiftcity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombuildsstuff%2Fswiftcity/lists"}