Skip to content

Latest commit

 

History

History
396 lines (243 loc) · 8.76 KB

GophersApi.md

File metadata and controls

396 lines (243 loc) · 8.76 KB

\GophersApi

All URIs are relative to http://localhost:8080

Method HTTP request Description
CheckHealth Get /healthz
GopherDelete Delete /gopher
GopherGet Get /gopher
GopherPost Post /gopher Add a new Gopher
GopherPut Put /gopher
GophersGet Get /gophers

CheckHealth

string CheckHealth(ctx).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/scraly/gophers-sdk-go"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.GophersApi.CheckHealth(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GophersApi.CheckHealth``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CheckHealth`: string
    fmt.Fprintf(os.Stdout, "Response from `GophersApi.CheckHealth`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiCheckHealthRequest struct via the builder pattern

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

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

GopherDelete

GopherDelete(ctx).Name(name).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/scraly/gophers-sdk-go"
)

func main() {
    name := "name_example" // string | Gopher name

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.GophersApi.GopherDelete(context.Background()).Name(name).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GophersApi.GopherDelete``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGopherDeleteRequest struct via the builder pattern

Name Type Description Notes
name string Gopher name

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GopherGet

Gopher GopherGet(ctx).Name(name).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/scraly/gophers-sdk-go"
)

func main() {
    name := "name_example" // string | Gopher name

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.GophersApi.GopherGet(context.Background()).Name(name).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GophersApi.GopherGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GopherGet`: Gopher
    fmt.Fprintf(os.Stdout, "Response from `GophersApi.GopherGet`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGopherGetRequest struct via the builder pattern

Name Type Description Notes
name string Gopher name

Return type

Gopher

Authorization

No authorization required

HTTP request headers

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

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

GopherPost

Gopher GopherPost(ctx).Gopher(gopher).Execute()

Add a new Gopher

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/scraly/gophers-sdk-go"
)

func main() {
    gopher := *openapiclient.NewGopherPutRequest("Name_example", "Displayname_example", "Url_example") // GopherPutRequest | The Gopher to create. (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.GophersApi.GopherPost(context.Background()).Gopher(gopher).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GophersApi.GopherPost``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GopherPost`: Gopher
    fmt.Fprintf(os.Stdout, "Response from `GophersApi.GopherPost`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGopherPostRequest struct via the builder pattern

Name Type Description Notes
gopher GopherPutRequest The Gopher to create.

Return type

Gopher

Authorization

No authorization required

HTTP request headers

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

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

GopherPut

Gopher GopherPut(ctx).Gopher(gopher).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/scraly/gophers-sdk-go"
)

func main() {
    gopher := *openapiclient.NewGopherPutRequest("Name_example", "Displayname_example", "Url_example") // GopherPutRequest | The Gopher to update. (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.GophersApi.GopherPut(context.Background()).Gopher(gopher).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GophersApi.GopherPut``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GopherPut`: Gopher
    fmt.Fprintf(os.Stdout, "Response from `GophersApi.GopherPut`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGopherPutRequest struct via the builder pattern

Name Type Description Notes
gopher GopherPutRequest The Gopher to update.

Return type

Gopher

Authorization

No authorization required

HTTP request headers

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

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

GophersGet

[]Gopher GophersGet(ctx).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/scraly/gophers-sdk-go"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.GophersApi.GophersGet(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GophersApi.GophersGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GophersGet`: []Gopher
    fmt.Fprintf(os.Stdout, "Response from `GophersApi.GophersGet`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGophersGetRequest struct via the builder pattern

Return type

[]Gopher

Authorization

No authorization required

HTTP request headers

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

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