Skip to content

Latest commit

 

History

History
437 lines (287 loc) · 12.3 KB

ConnectionApi.md

File metadata and controls

437 lines (287 loc) · 12.3 KB

\ConnectionApi

All URIs are relative to http://localhost/api/v1

Method HTTP request Description
DeleteConnection Delete /connections/{connection_id} Delete a connection
GetConnection Get /connections/{connection_id} Get a connection
GetConnections Get /connections List connections
PatchConnection Patch /connections/{connection_id} Update a connection
PostConnection Post /connections Create a connection
TestConnection Post /connections/test Test a connection

DeleteConnection

DeleteConnection(ctx, connectionId).Execute()

Delete a connection

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    connectionId := "connectionId_example" // string | The connection ID.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ConnectionApi.DeleteConnection(context.Background(), connectionId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.DeleteConnection``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
connectionId string The connection ID.

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

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]

GetConnection

Connection GetConnection(ctx, connectionId).Execute()

Get a connection

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    connectionId := "connectionId_example" // string | The connection ID.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
connectionId string The connection ID.

Other Parameters

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

Name Type Description Notes

Return type

Connection

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]

GetConnections

ConnectionCollection GetConnections(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Execute()

List connections

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100)
    offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional)
    orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order.  *New in version 2.1.0*  (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ConnectionApi.GetConnections(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.GetConnections``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetConnections`: ConnectionCollection
    fmt.Fprintf(os.Stdout, "Response from `ConnectionApi.GetConnections`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
limit int32 The numbers of items to return. [default to 100]
offset int32 The number of items to skip before starting to collect the result set.
orderBy string The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. New in version 2.1.0

Return type

ConnectionCollection

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]

PatchConnection

Connection PatchConnection(ctx, connectionId).Connection(connection).UpdateMask(updateMask).Execute()

Update a connection

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    connectionId := "connectionId_example" // string | The connection ID.
    connection := *openapiclient.NewConnection() // Connection | 
    updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields.  (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ConnectionApi.PatchConnection(context.Background(), connectionId).Connection(connection).UpdateMask(updateMask).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.PatchConnection``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PatchConnection`: Connection
    fmt.Fprintf(os.Stdout, "Response from `ConnectionApi.PatchConnection`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
connectionId string The connection ID.

Other Parameters

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

Name Type Description Notes

connection | Connection | | updateMask | []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. |

Return type

Connection

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]

PostConnection

Connection PostConnection(ctx).Connection(connection).Execute()

Create a connection

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    connection := *openapiclient.NewConnection() // Connection | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
connection Connection

Return type

Connection

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]

TestConnection

ConnectionTest TestConnection(ctx).Connection(connection).Execute()

Test a connection

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    connection := *openapiclient.NewConnection() // Connection | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
connection Connection

Return type

ConnectionTest

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]