package
0.0.0-20241211132550-280de691300e
Repository: https://github.com/openshift-online/maestro.git
Documentation: pkg.go.dev

# README

Go API client for openapi

maestro Service API

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 0.0.1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
DefaultApiApiMaestroV1ConsumersGetGet /api/maestro/v1/consumersReturns a list of consumers
DefaultApiApiMaestroV1ConsumersIdDeleteDelete /api/maestro/v1/consumers/{id}Delete a consumer
DefaultApiApiMaestroV1ConsumersIdGetGet /api/maestro/v1/consumers/{id}Get an consumer by id
DefaultApiApiMaestroV1ConsumersIdPatchPatch /api/maestro/v1/consumers/{id}Update an consumer
DefaultApiApiMaestroV1ConsumersPostPost /api/maestro/v1/consumersCreate a new consumer
DefaultApiApiMaestroV1ResourceBundlesGetGet /api/maestro/v1/resource-bundlesReturns a list of resource bundles
DefaultApiApiMaestroV1ResourceBundlesIdGetGet /api/maestro/v1/resource-bundles/{id}Get an resource bundle by id
DefaultApiApiMaestroV1ResourcesGetGet /api/maestro/v1/resourcesReturns a list of resources
DefaultApiApiMaestroV1ResourcesIdDeleteDelete /api/maestro/v1/resources/{id}Delete a resource
DefaultApiApiMaestroV1ResourcesIdGetGet /api/maestro/v1/resources/{id}Get an resource by id
DefaultApiApiMaestroV1ResourcesIdPatchPatch /api/maestro/v1/resources/{id}Update an resource
DefaultApiApiMaestroV1ResourcesPostPost /api/maestro/v1/resourcesCreate a new resource

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

Bearer

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
IsNil checks if an input is nil.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResponse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewConfiguration returns a new Configuration object.
NewConsumer instantiates a new Consumer object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConsumerAllOf instantiates a new ConsumerAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConsumerAllOfWithDefaults instantiates a new ConsumerAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConsumerList instantiates a new ConsumerList object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConsumerListAllOf instantiates a new ConsumerListAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConsumerListAllOfWithDefaults instantiates a new ConsumerListAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConsumerListWithDefaults instantiates a new ConsumerList object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConsumerPatchRequest instantiates a new ConsumerPatchRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConsumerPatchRequestWithDefaults instantiates a new ConsumerPatchRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConsumerWithDefaults instantiates a new Consumer object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewError instantiates a new Error object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewErrorAllOf instantiates a new ErrorAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewErrorAllOfWithDefaults instantiates a new ErrorAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewErrorList instantiates a new ErrorList object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewErrorListAllOf instantiates a new ErrorListAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewErrorListAllOfWithDefaults instantiates a new ErrorListAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewErrorListWithDefaults instantiates a new ErrorList object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewErrorWithDefaults instantiates a new Error object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewList instantiates a new List object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewListWithDefaults instantiates a new List object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewObjectReference instantiates a new ObjectReference object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewObjectReferenceWithDefaults instantiates a new ObjectReference object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResource instantiates a new Resource object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourceAllOf instantiates a new ResourceAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourceAllOfWithDefaults instantiates a new ResourceAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResourceBundle instantiates a new ResourceBundle object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourceBundleAllOf instantiates a new ResourceBundleAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourceBundleAllOfWithDefaults instantiates a new ResourceBundleAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResourceBundleList instantiates a new ResourceBundleList object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourceBundleListAllOf instantiates a new ResourceBundleListAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourceBundleListAllOfWithDefaults instantiates a new ResourceBundleListAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResourceBundleListWithDefaults instantiates a new ResourceBundleList object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResourceBundleWithDefaults instantiates a new ResourceBundle object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResourceList instantiates a new ResourceList object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourceListAllOf instantiates a new ResourceListAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourceListAllOfWithDefaults instantiates a new ResourceListAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResourceListWithDefaults instantiates a new ResourceList object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResourcePatchRequest instantiates a new ResourcePatchRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewResourcePatchRequestWithDefaults instantiates a new ResourcePatchRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewResourceWithDefaults instantiates a new Resource object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
PtrBool is a helper routine that returns a pointer to given boolean value.
PtrFloat32 is a helper routine that returns a pointer to given float value.
PtrFloat64 is a helper routine that returns a pointer to given float value.
PtrInt is a helper routine that returns a pointer to given integer value.
PtrInt32 is a helper routine that returns a pointer to given integer value.
PtrInt64 is a helper routine that returns a pointer to given integer value.
PtrString is a helper routine that returns a pointer to given string value.
PtrTime is helper routine that returns a pointer to given Time value.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextServerIndex uses a server configuration from the index.
ContextServerVariables overrides a server configuration variables.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIClient manages communication with the maestro Service API API v0.0.1 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
APIResponse stores the API response returned by the server.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Configuration stores the configuration of the API client.
Consumer struct for Consumer.
ConsumerAllOf struct for ConsumerAllOf.
ConsumerList struct for ConsumerList.
ConsumerListAllOf struct for ConsumerListAllOf.
ConsumerPatchRequest struct for ConsumerPatchRequest.
Error struct for Error.
ErrorAllOf struct for ErrorAllOf.
ErrorList struct for ErrorList.
ErrorListAllOf struct for ErrorListAllOf.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
List struct for List.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ObjectReference struct for ObjectReference.
Resource struct for Resource.
ResourceAllOf struct for ResourceAllOf.
ResourceBundle struct for ResourceBundle.
ResourceBundleAllOf struct for ResourceBundleAllOf.
ResourceBundleList struct for ResourceBundleList.
ResourceBundleListAllOf struct for ResourceBundleListAllOf.
ResourceList struct for ResourceList.
ResourceListAllOf struct for ResourceListAllOf.
ResourcePatchRequest struct for ResourcePatchRequest.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.

# Interfaces

No description provided by the author

# Type aliases

DefaultApiService DefaultApi service.
ServerConfigurations stores multiple ServerConfiguration items.