Skip to content

Latest commit

 

History

History
296 lines (204 loc) · 7.71 KB

File metadata and controls

296 lines (204 loc) · 7.71 KB

GoalAPI

All URIs are relative to https://finchapp.eastus.cloudapp.azure.com/api

Method HTTP request Description
deleteGoal DELETE /goal/{id} Delete one specific goal by id
getGoal GET /goal/{id} Get one specific goal by id
getGoalExamples GET /goal/examples Get example Goals
getGoals GET /goals Get all of a user's goals
newGoal POST /goal/new Creates a new goal for the user
updateGoal PUT /goal/{id} Update one specific goal by id

deleteGoal

    open class func deleteGoal(id: String, completion: @escaping (_ data: GoalAndStatus?, _ error: Error?) -> Void)

Delete one specific goal by id

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import OpenAPIClient

let id = "id_example" // String | Numeric ID of the Goal to delete

// Delete one specific goal by id
GoalAPI.deleteGoal(id: id) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
id String Numeric ID of the Goal to delete

Return type

GoalAndStatus

Authorization

sidCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGoal

    open class func getGoal(id: String, completion: @escaping (_ data: GoalAndStatus?, _ error: Error?) -> Void)

Get one specific goal by id

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import OpenAPIClient

let id = "id_example" // String | Numeric ID of the Goal to get

// Get one specific goal by id
GoalAPI.getGoal(id: id) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
id String Numeric ID of the Goal to get

Return type

GoalAndStatus

Authorization

sidCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGoalExamples

    open class func getGoalExamples(completion: @escaping (_ data: [GoalNewPayload]?, _ error: Error?) -> Void)

Get example Goals

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import OpenAPIClient


// Get example Goals
GoalAPI.getGoalExamples() { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

This endpoint does not need any parameter.

Return type

[GoalNewPayload]

Authorization

sidCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGoals

    open class func getGoals(completion: @escaping (_ data: [GoalAndStatus]?, _ error: Error?) -> Void)

Get all of a user's goals

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import OpenAPIClient


// Get all of a user's goals
GoalAPI.getGoals() { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

This endpoint does not need any parameter.

Return type

[GoalAndStatus]

Authorization

sidCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

newGoal

    open class func newGoal(goalNewPayload: GoalNewPayload, completion: @escaping (_ data: GoalAndStatus?, _ error: Error?) -> Void)

Creates a new goal for the user

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import OpenAPIClient

let goalNewPayload = GoalNewPayload(name: "name_example", start: 123, end: 123, threshold: 123, metric: GoalMetric()) // GoalNewPayload | 

// Creates a new goal for the user
GoalAPI.newGoal(goalNewPayload: goalNewPayload) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
goalNewPayload GoalNewPayload

Return type

GoalAndStatus

Authorization

sidCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateGoal

    open class func updateGoal(id: String, goalNewPayload: GoalNewPayload, completion: @escaping (_ data: GoalAndStatus?, _ error: Error?) -> Void)

Update one specific goal by id

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import OpenAPIClient

let id = "id_example" // String | Numeric ID of the Goal to update
let goalNewPayload = GoalNewPayload(name: "name_example", start: 123, end: 123, threshold: 123, metric: GoalMetric()) // GoalNewPayload | 

// Update one specific goal by id
GoalAPI.updateGoal(id: id, goalNewPayload: goalNewPayload) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
id String Numeric ID of the Goal to update
goalNewPayload GoalNewPayload

Return type

GoalAndStatus

Authorization

sidCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]