Skip to content

Latest commit

 

History

History
376 lines (245 loc) · 10.4 KB

VariableApi.md

File metadata and controls

376 lines (245 loc) · 10.4 KB

\VariableApi

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

Method HTTP request Description
DeleteVariable Delete /variables/{variable_key} Delete a variable
GetVariable Get /variables/{variable_key} Get a variable
GetVariables Get /variables List variables
PatchVariable Patch /variables/{variable_key} Update a variable
PostVariables Post /variables Create a variable

DeleteVariable

DeleteVariable(ctx, variableKey).Execute()

Delete a variable

Example

package main

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

func main() {
    variableKey := "variableKey_example" // string | The variable Key.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.VariableApi.DeleteVariable(context.Background(), variableKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VariableApi.DeleteVariable``: %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.
variableKey string The variable Key.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteVariableRequest 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]

GetVariable

Variable GetVariable(ctx, variableKey).Execute()

Get a variable

Example

package main

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

func main() {
    variableKey := "variableKey_example" // string | The variable Key.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
variableKey string The variable Key.

Other Parameters

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

Name Type Description Notes

Return type

Variable

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]

GetVariables

VariableCollection GetVariables(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Execute()

List variables

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.VariableApi.GetVariables(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VariableApi.GetVariables``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetVariables`: VariableCollection
    fmt.Fprintf(os.Stdout, "Response from `VariableApi.GetVariables`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetVariablesRequest 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

VariableCollection

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]

PatchVariable

Variable PatchVariable(ctx, variableKey).Variable(variable).UpdateMask(updateMask).Execute()

Update a variable

Example

package main

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

func main() {
    variableKey := "variableKey_example" // string | The variable Key.
    variable := *openapiclient.NewVariable() // Variable | 
    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.VariableApi.PatchVariable(context.Background(), variableKey).Variable(variable).UpdateMask(updateMask).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VariableApi.PatchVariable``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PatchVariable`: Variable
    fmt.Fprintf(os.Stdout, "Response from `VariableApi.PatchVariable`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
variableKey string The variable Key.

Other Parameters

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

Name Type Description Notes

variable | Variable | | 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

Variable

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]

PostVariables

Variable PostVariables(ctx).Variable(variable).Execute()

Create a variable

Example

package main

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

func main() {
    variable := *openapiclient.NewVariable() // Variable | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
variable Variable

Return type

Variable

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]