{"id":20926104,"url":"https://github.com/starhoshi/callable","last_synced_at":"2025-05-13T17:33:21.395Z","repository":{"id":30952687,"uuid":"126478828","full_name":"starhoshi/Callable","owner":"starhoshi","description":"Type-safe Firebase HTTPS Callable Functions client using Decodable","archived":false,"fork":false,"pushed_at":"2022-10-06T00:04:39.000Z","size":66,"stargazers_count":6,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-17T01:58:06.475Z","etag":null,"topics":["cloudfunctions","cocoapods","decodable","firebase","ios","swift"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/starhoshi.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":"2018-03-23T11:56:53.000Z","updated_at":"2019-12-18T12:02:57.000Z","dependencies_parsed_at":"2022-08-07T16:00:27.741Z","dependency_job_id":null,"html_url":"https://github.com/starhoshi/Callable","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starhoshi%2FCallable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starhoshi%2FCallable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starhoshi%2FCallable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starhoshi%2FCallable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starhoshi","download_url":"https://codeload.github.com/starhoshi/Callable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253993590,"owners_count":21996343,"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":["cloudfunctions","cocoapods","decodable","firebase","ios","swift"],"created_at":"2024-11-18T20:36:48.355Z","updated_at":"2025-05-13T17:33:21.115Z","avatar_url":"https://github.com/starhoshi.png","language":"Ruby","readme":"# Callable\n\n![](https://cocoapod-badges.herokuapp.com/v/Callable/badge.png)\n![](https://cocoapod-badges.herokuapp.com/p/Callable/badge.png)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\u003c!-- [![Build Status](https://travis-ci.org/starhoshi/Callable.svg?branch=master)](https://travis-ci.org/starhoshi/Callable) --\u003e\n\nType-safe [Firebase HTTPS Callable Functions](https://firebase.google.com/docs/functions/callable) client using Decodable.\n\n# Installation\n\n```\npod 'Callable'\n```\n\n# Usage\n\n## Define endpoint and Response\n\nYou need to define `Response` extend `Decodable`.\n\n* path\n    * The name of the Callable HTTPS trigger.\n* parameter\n    * Parameters to pass to the trigger.\n\n```swift\nstruct SampleResponse: Decodable {\n    let name: String\n}\n\nstruct Sample: Callable {\n    typealias Response = SampleResponse\n    let name: String\n\n    init(name: String) {\n        self.name = name\n    }\n\n    var path: String {\n        return \"httpcallable\"\n    }\n\n    var parameter: [String: Any]? {\n        return [\"name\": name]\n    }\n}\n```\n\n## Call endpoint\n\nIf the request succeeds, `Response` type will be returned.\n\n```swift\nlet sample = Sample(name: \"Jobs\")\nsample.call { result in\n    switch result {\n    case .success(let resonse):\n        print(resonse)\n    case .failure(let error):\n        print(error)\n    }\n}\n```\n\n\n* CallableError\n    * function(Error)\n        * server threw an error or if the resulting promise was rejected.\n    * decode(Error) \n        * decode failed\n    * illegalCombination(Any?, Error?)\n        * both result and error exist, or nil\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarhoshi%2Fcallable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarhoshi%2Fcallable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarhoshi%2Fcallable/lists"}