This commit is contained in:
Manabu Mccloskey 2023-06-26 11:54:07 -07:00
parent 670f86cd1f
commit 8cc9d98bb9
42 changed files with 90 additions and 178808 deletions

View file

@ -1,483 +0,0 @@
# .ArchivedWorkflowServiceApi
All URIs are relative to *http://localhost:2746*
Method | HTTP request | Description
------------- | ------------- | -------------
[**archivedWorkflowServiceDeleteArchivedWorkflow**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceDeleteArchivedWorkflow) | **DELETE** /api/v1/archived-workflows/{uid} |
[**archivedWorkflowServiceGetArchivedWorkflow**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceGetArchivedWorkflow) | **GET** /api/v1/archived-workflows/{uid} |
[**archivedWorkflowServiceListArchivedWorkflowLabelKeys**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceListArchivedWorkflowLabelKeys) | **GET** /api/v1/archived-workflows-label-keys |
[**archivedWorkflowServiceListArchivedWorkflowLabelValues**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceListArchivedWorkflowLabelValues) | **GET** /api/v1/archived-workflows-label-values |
[**archivedWorkflowServiceListArchivedWorkflows**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceListArchivedWorkflows) | **GET** /api/v1/archived-workflows |
[**archivedWorkflowServiceResubmitArchivedWorkflow**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceResubmitArchivedWorkflow) | **PUT** /api/v1/archived-workflows/{uid}/resubmit |
[**archivedWorkflowServiceRetryArchivedWorkflow**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceRetryArchivedWorkflow) | **PUT** /api/v1/archived-workflows/{uid}/retry |
# **archivedWorkflowServiceDeleteArchivedWorkflow**
> any archivedWorkflowServiceDeleteArchivedWorkflow()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArchivedWorkflowServiceApi(configuration);
let body:.ArchivedWorkflowServiceApiArchivedWorkflowServiceDeleteArchivedWorkflowRequest = {
// string
uid: "uid_example",
// string (optional)
namespace: "namespace_example",
};
apiInstance.archivedWorkflowServiceDeleteArchivedWorkflow(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uid** | [**string**] | | defaults to undefined
**namespace** | [**string**] | | (optional) defaults to undefined
### Return type
**any**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **archivedWorkflowServiceGetArchivedWorkflow**
> IoArgoprojWorkflowV1alpha1Workflow archivedWorkflowServiceGetArchivedWorkflow()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArchivedWorkflowServiceApi(configuration);
let body:.ArchivedWorkflowServiceApiArchivedWorkflowServiceGetArchivedWorkflowRequest = {
// string
uid: "uid_example",
// string (optional)
namespace: "namespace_example",
// string (optional)
name: "name_example",
};
apiInstance.archivedWorkflowServiceGetArchivedWorkflow(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uid** | [**string**] | | defaults to undefined
**namespace** | [**string**] | | (optional) defaults to undefined
**name** | [**string**] | | (optional) defaults to undefined
### Return type
**IoArgoprojWorkflowV1alpha1Workflow**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **archivedWorkflowServiceListArchivedWorkflowLabelKeys**
> IoArgoprojWorkflowV1alpha1LabelKeys archivedWorkflowServiceListArchivedWorkflowLabelKeys()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArchivedWorkflowServiceApi(configuration);
let body:.ArchivedWorkflowServiceApiArchivedWorkflowServiceListArchivedWorkflowLabelKeysRequest = {
// string (optional)
namespace: "namespace_example",
};
apiInstance.archivedWorkflowServiceListArchivedWorkflowLabelKeys(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**namespace** | [**string**] | | (optional) defaults to undefined
### Return type
**IoArgoprojWorkflowV1alpha1LabelKeys**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **archivedWorkflowServiceListArchivedWorkflowLabelValues**
> IoArgoprojWorkflowV1alpha1LabelValues archivedWorkflowServiceListArchivedWorkflowLabelValues()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArchivedWorkflowServiceApi(configuration);
let body:.ArchivedWorkflowServiceApiArchivedWorkflowServiceListArchivedWorkflowLabelValuesRequest = {
// string | A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional. (optional)
listOptionsLabelSelector: "listOptions.labelSelector_example",
// string | A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional. (optional)
listOptionsFieldSelector: "listOptions.fieldSelector_example",
// boolean | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional. (optional)
listOptionsWatch: true,
// boolean | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional. (optional)
listOptionsAllowWatchBookmarks: true,
// string | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional (optional)
listOptionsResourceVersion: "listOptions.resourceVersion_example",
// string | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional (optional)
listOptionsResourceVersionMatch: "listOptions.resourceVersionMatch_example",
// string | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional. (optional)
listOptionsTimeoutSeconds: "listOptions.timeoutSeconds_example",
// string | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional)
listOptionsLimit: "listOptions.limit_example",
// string | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional)
listOptionsContinue: "listOptions.continue_example",
// string (optional)
namespace: "namespace_example",
};
apiInstance.archivedWorkflowServiceListArchivedWorkflowLabelValues(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**listOptionsLabelSelector** | [**string**] | A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional. | (optional) defaults to undefined
**listOptionsFieldSelector** | [**string**] | A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional. | (optional) defaults to undefined
**listOptionsWatch** | [**boolean**] | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional. | (optional) defaults to undefined
**listOptionsAllowWatchBookmarks** | [**boolean**] | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional. | (optional) defaults to undefined
**listOptionsResourceVersion** | [**string**] | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional | (optional) defaults to undefined
**listOptionsResourceVersionMatch** | [**string**] | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional | (optional) defaults to undefined
**listOptionsTimeoutSeconds** | [**string**] | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional. | (optional) defaults to undefined
**listOptionsLimit** | [**string**] | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | (optional) defaults to undefined
**listOptionsContinue** | [**string**] | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | (optional) defaults to undefined
**namespace** | [**string**] | | (optional) defaults to undefined
### Return type
**IoArgoprojWorkflowV1alpha1LabelValues**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **archivedWorkflowServiceListArchivedWorkflows**
> IoArgoprojWorkflowV1alpha1WorkflowList archivedWorkflowServiceListArchivedWorkflows()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArchivedWorkflowServiceApi(configuration);
let body:.ArchivedWorkflowServiceApiArchivedWorkflowServiceListArchivedWorkflowsRequest = {
// string | A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional. (optional)
listOptionsLabelSelector: "listOptions.labelSelector_example",
// string | A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional. (optional)
listOptionsFieldSelector: "listOptions.fieldSelector_example",
// boolean | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional. (optional)
listOptionsWatch: true,
// boolean | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional. (optional)
listOptionsAllowWatchBookmarks: true,
// string | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional (optional)
listOptionsResourceVersion: "listOptions.resourceVersion_example",
// string | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional (optional)
listOptionsResourceVersionMatch: "listOptions.resourceVersionMatch_example",
// string | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional. (optional)
listOptionsTimeoutSeconds: "listOptions.timeoutSeconds_example",
// string | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional)
listOptionsLimit: "listOptions.limit_example",
// string | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional)
listOptionsContinue: "listOptions.continue_example",
// string (optional)
namePrefix: "namePrefix_example",
// string (optional)
namespace: "namespace_example",
};
apiInstance.archivedWorkflowServiceListArchivedWorkflows(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**listOptionsLabelSelector** | [**string**] | A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional. | (optional) defaults to undefined
**listOptionsFieldSelector** | [**string**] | A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional. | (optional) defaults to undefined
**listOptionsWatch** | [**boolean**] | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional. | (optional) defaults to undefined
**listOptionsAllowWatchBookmarks** | [**boolean**] | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional. | (optional) defaults to undefined
**listOptionsResourceVersion** | [**string**] | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional | (optional) defaults to undefined
**listOptionsResourceVersionMatch** | [**string**] | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional | (optional) defaults to undefined
**listOptionsTimeoutSeconds** | [**string**] | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional. | (optional) defaults to undefined
**listOptionsLimit** | [**string**] | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | (optional) defaults to undefined
**listOptionsContinue** | [**string**] | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | (optional) defaults to undefined
**namePrefix** | [**string**] | | (optional) defaults to undefined
**namespace** | [**string**] | | (optional) defaults to undefined
### Return type
**IoArgoprojWorkflowV1alpha1WorkflowList**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **archivedWorkflowServiceResubmitArchivedWorkflow**
> IoArgoprojWorkflowV1alpha1Workflow archivedWorkflowServiceResubmitArchivedWorkflow(body)
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArchivedWorkflowServiceApi(configuration);
let body:.ArchivedWorkflowServiceApiArchivedWorkflowServiceResubmitArchivedWorkflowRequest = {
// string
uid: "uid_example",
// IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest
body: {
memoized: true,
name: "name_example",
namespace: "namespace_example",
parameters: [
"parameters_example",
],
uid: "uid_example",
},
};
apiInstance.archivedWorkflowServiceResubmitArchivedWorkflow(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest**| |
**uid** | [**string**] | | defaults to undefined
### Return type
**IoArgoprojWorkflowV1alpha1Workflow**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **archivedWorkflowServiceRetryArchivedWorkflow**
> IoArgoprojWorkflowV1alpha1Workflow archivedWorkflowServiceRetryArchivedWorkflow(body)
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArchivedWorkflowServiceApi(configuration);
let body:.ArchivedWorkflowServiceApiArchivedWorkflowServiceRetryArchivedWorkflowRequest = {
// string
uid: "uid_example",
// IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest
body: {
name: "name_example",
namespace: "namespace_example",
nodeFieldSelector: "nodeFieldSelector_example",
parameters: [
"parameters_example",
],
restartSuccessful: true,
uid: "uid_example",
},
};
apiInstance.archivedWorkflowServiceRetryArchivedWorkflow(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest**| |
**uid** | [**string**] | | defaults to undefined
### Return type
**IoArgoprojWorkflowV1alpha1Workflow**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View file

@ -1,329 +0,0 @@
# .ArtifactServiceApi
All URIs are relative to *http://localhost:2746*
Method | HTTP request | Description
------------- | ------------- | -------------
[**artifactServiceGetArtifactFile**](ArtifactServiceApi.md#artifactServiceGetArtifactFile) | **GET** /artifact-files/{namespace}/{idDiscriminator}/{id}/{nodeId}/{artifactDiscriminator}/{artifactName} | Get an artifact.
[**artifactServiceGetInputArtifact**](ArtifactServiceApi.md#artifactServiceGetInputArtifact) | **GET** /input-artifacts/{namespace}/{name}/{nodeId}/{artifactName} | Get an input artifact.
[**artifactServiceGetInputArtifactByUID**](ArtifactServiceApi.md#artifactServiceGetInputArtifactByUID) | **GET** /input-artifacts-by-uid/{uid}/{nodeId}/{artifactName} | Get an input artifact by UID.
[**artifactServiceGetOutputArtifact**](ArtifactServiceApi.md#artifactServiceGetOutputArtifact) | **GET** /artifacts/{namespace}/{name}/{nodeId}/{artifactName} | Get an output artifact.
[**artifactServiceGetOutputArtifactByUID**](ArtifactServiceApi.md#artifactServiceGetOutputArtifactByUID) | **GET** /artifacts-by-uid/{uid}/{nodeId}/{artifactName} | Get an output artifact by UID.
# **artifactServiceGetArtifactFile**
> HttpFile artifactServiceGetArtifactFile()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArtifactServiceApi(configuration);
let body:.ArtifactServiceApiArtifactServiceGetArtifactFileRequest = {
// string
namespace: "namespace_example",
// 'workflow' | 'archived-workflows '
idDiscriminator: "workflow",
// string
id: "id_example",
// string
nodeId: "nodeId_example",
// string
artifactName: "artifactName_example",
// 'outputs'
artifactDiscriminator: "outputs",
};
apiInstance.artifactServiceGetArtifactFile(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**namespace** | [**string**] | | defaults to undefined
**idDiscriminator** | [**&#39;workflow&#39; | &#39;archived-workflows &#39;**]**Array<&#39;workflow&#39; &#124; &#39;archived-workflows &#39;>** | | defaults to undefined
**id** | [**string**] | | defaults to undefined
**nodeId** | [**string**] | | defaults to undefined
**artifactName** | [**string**] | | defaults to undefined
**artifactDiscriminator** | [**&#39;outputs&#39;**]**Array<&#39;outputs&#39;>** | | defaults to undefined
### Return type
**HttpFile**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An artifact file. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **artifactServiceGetInputArtifact**
> HttpFile artifactServiceGetInputArtifact()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArtifactServiceApi(configuration);
let body:.ArtifactServiceApiArtifactServiceGetInputArtifactRequest = {
// string
namespace: "namespace_example",
// string
name: "name_example",
// string
nodeId: "nodeId_example",
// string
artifactName: "artifactName_example",
};
apiInstance.artifactServiceGetInputArtifact(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**namespace** | [**string**] | | defaults to undefined
**name** | [**string**] | | defaults to undefined
**nodeId** | [**string**] | | defaults to undefined
**artifactName** | [**string**] | | defaults to undefined
### Return type
**HttpFile**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An artifact file. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **artifactServiceGetInputArtifactByUID**
> HttpFile artifactServiceGetInputArtifactByUID()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArtifactServiceApi(configuration);
let body:.ArtifactServiceApiArtifactServiceGetInputArtifactByUIDRequest = {
// string
uid: "uid_example",
// string
nodeId: "nodeId_example",
// string
artifactName: "artifactName_example",
};
apiInstance.artifactServiceGetInputArtifactByUID(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uid** | [**string**] | | defaults to undefined
**nodeId** | [**string**] | | defaults to undefined
**artifactName** | [**string**] | | defaults to undefined
### Return type
**HttpFile**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An artifact file. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **artifactServiceGetOutputArtifact**
> HttpFile artifactServiceGetOutputArtifact()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArtifactServiceApi(configuration);
let body:.ArtifactServiceApiArtifactServiceGetOutputArtifactRequest = {
// string
namespace: "namespace_example",
// string
name: "name_example",
// string
nodeId: "nodeId_example",
// string
artifactName: "artifactName_example",
};
apiInstance.artifactServiceGetOutputArtifact(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**namespace** | [**string**] | | defaults to undefined
**name** | [**string**] | | defaults to undefined
**nodeId** | [**string**] | | defaults to undefined
**artifactName** | [**string**] | | defaults to undefined
### Return type
**HttpFile**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An artifact file. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **artifactServiceGetOutputArtifactByUID**
> HttpFile artifactServiceGetOutputArtifactByUID()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .ArtifactServiceApi(configuration);
let body:.ArtifactServiceApiArtifactServiceGetOutputArtifactByUIDRequest = {
// string
uid: "uid_example",
// string
nodeId: "nodeId_example",
// string
artifactName: "artifactName_example",
};
apiInstance.artifactServiceGetOutputArtifactByUID(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uid** | [**string**] | | defaults to undefined
**nodeId** | [**string**] | | defaults to undefined
**artifactName** | [**string**] | | defaults to undefined
### Return type
**HttpFile**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An artifact file. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View file

@ -1,152 +0,0 @@
# .EventServiceApi
All URIs are relative to *http://localhost:2746*
Method | HTTP request | Description
------------- | ------------- | -------------
[**eventServiceListWorkflowEventBindings**](EventServiceApi.md#eventServiceListWorkflowEventBindings) | **GET** /api/v1/workflow-event-bindings/{namespace} |
[**eventServiceReceiveEvent**](EventServiceApi.md#eventServiceReceiveEvent) | **POST** /api/v1/events/{namespace}/{discriminator} |
# **eventServiceListWorkflowEventBindings**
> IoArgoprojWorkflowV1alpha1WorkflowEventBindingList eventServiceListWorkflowEventBindings()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .EventServiceApi(configuration);
let body:.EventServiceApiEventServiceListWorkflowEventBindingsRequest = {
// string
namespace: "namespace_example",
// string | A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional. (optional)
listOptionsLabelSelector: "listOptions.labelSelector_example",
// string | A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional. (optional)
listOptionsFieldSelector: "listOptions.fieldSelector_example",
// boolean | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional. (optional)
listOptionsWatch: true,
// boolean | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional. (optional)
listOptionsAllowWatchBookmarks: true,
// string | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional (optional)
listOptionsResourceVersion: "listOptions.resourceVersion_example",
// string | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional (optional)
listOptionsResourceVersionMatch: "listOptions.resourceVersionMatch_example",
// string | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional. (optional)
listOptionsTimeoutSeconds: "listOptions.timeoutSeconds_example",
// string | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional)
listOptionsLimit: "listOptions.limit_example",
// string | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional)
listOptionsContinue: "listOptions.continue_example",
};
apiInstance.eventServiceListWorkflowEventBindings(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**namespace** | [**string**] | | defaults to undefined
**listOptionsLabelSelector** | [**string**] | A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional. | (optional) defaults to undefined
**listOptionsFieldSelector** | [**string**] | A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional. | (optional) defaults to undefined
**listOptionsWatch** | [**boolean**] | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional. | (optional) defaults to undefined
**listOptionsAllowWatchBookmarks** | [**boolean**] | allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional. | (optional) defaults to undefined
**listOptionsResourceVersion** | [**string**] | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional | (optional) defaults to undefined
**listOptionsResourceVersionMatch** | [**string**] | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional | (optional) defaults to undefined
**listOptionsTimeoutSeconds** | [**string**] | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional. | (optional) defaults to undefined
**listOptionsLimit** | [**string**] | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | (optional) defaults to undefined
**listOptionsContinue** | [**string**] | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | (optional) defaults to undefined
### Return type
**IoArgoprojWorkflowV1alpha1WorkflowEventBindingList**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **eventServiceReceiveEvent**
> any eventServiceReceiveEvent(body)
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .EventServiceApi(configuration);
let body:.EventServiceApiEventServiceReceiveEventRequest = {
// string | The namespace for the io.argoproj.workflow.v1alpha1. This can be empty if the client has cluster scoped permissions. If empty, then the event is \"broadcast\" to workflow event binding in all namespaces.
namespace: "namespace_example",
// string | Optional discriminator for the io.argoproj.workflow.v1alpha1. This should almost always be empty. Used for edge-cases where the event payload alone is not provide enough information to discriminate the event. This MUST NOT be used as security mechanism, e.g. to allow two clients to use the same access token, or to support webhooks on unsecured server. Instead, use access tokens. This is made available as `discriminator` in the event binding selector (`/spec/event/selector)`
discriminator: "discriminator_example",
// any | The event itself can be any data.
body: {},
};
apiInstance.eventServiceReceiveEvent(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **any**| The event itself can be any data. |
**namespace** | [**string**] | The namespace for the io.argoproj.workflow.v1alpha1. This can be empty if the client has cluster scoped permissions. If empty, then the event is \&quot;broadcast\&quot; to workflow event binding in all namespaces. | defaults to undefined
**discriminator** | [**string**] | Optional discriminator for the io.argoproj.workflow.v1alpha1. This should almost always be empty. Used for edge-cases where the event payload alone is not provide enough information to discriminate the event. This MUST NOT be used as security mechanism, e.g. to allow two clients to use the same access token, or to support webhooks on unsecured server. Instead, use access tokens. This is made available as &#x60;discriminator&#x60; in the event binding selector (&#x60;/spec/event/selector)&#x60; | defaults to undefined
### Return type
**any**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View file

@ -1,213 +0,0 @@
# .InfoServiceApi
All URIs are relative to *http://localhost:2746*
Method | HTTP request | Description
------------- | ------------- | -------------
[**infoServiceCollectEvent**](InfoServiceApi.md#infoServiceCollectEvent) | **POST** /api/v1/tracking/event |
[**infoServiceGetInfo**](InfoServiceApi.md#infoServiceGetInfo) | **GET** /api/v1/info |
[**infoServiceGetUserInfo**](InfoServiceApi.md#infoServiceGetUserInfo) | **GET** /api/v1/userinfo |
[**infoServiceGetVersion**](InfoServiceApi.md#infoServiceGetVersion) | **GET** /api/v1/version |
# **infoServiceCollectEvent**
> any infoServiceCollectEvent(body)
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .InfoServiceApi(configuration);
let body:.InfoServiceApiInfoServiceCollectEventRequest = {
// IoArgoprojWorkflowV1alpha1CollectEventRequest
body: {
name: "name_example",
},
};
apiInstance.infoServiceCollectEvent(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **IoArgoprojWorkflowV1alpha1CollectEventRequest**| |
### Return type
**any**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **infoServiceGetInfo**
> IoArgoprojWorkflowV1alpha1InfoResponse infoServiceGetInfo()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .InfoServiceApi(configuration);
let body:any = {};
apiInstance.infoServiceGetInfo(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
This endpoint does not need any parameter.
### Return type
**IoArgoprojWorkflowV1alpha1InfoResponse**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **infoServiceGetUserInfo**
> IoArgoprojWorkflowV1alpha1GetUserInfoResponse infoServiceGetUserInfo()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .InfoServiceApi(configuration);
let body:any = {};
apiInstance.infoServiceGetUserInfo(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
This endpoint does not need any parameter.
### Return type
**IoArgoprojWorkflowV1alpha1GetUserInfoResponse**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
# **infoServiceGetVersion**
> IoArgoprojWorkflowV1alpha1Version infoServiceGetVersion()
### Example
```typescript
import { } from '';
import * as fs from 'fs';
const configuration = .createConfiguration();
const apiInstance = new .InfoServiceApi(configuration);
let body:any = {};
apiInstance.infoServiceGetVersion(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
```
### Parameters
This endpoint does not need any parameter.
### Return type
**IoArgoprojWorkflowV1alpha1Version**
### Authorization
[BearerToken](README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)

View file

@ -1,80 +0,0 @@
## @
This generator creates TypeScript/JavaScript client that utilizes fetch-api.
### Building
To build and compile the typescript sources to javascript use:
```
npm install
npm run build
```
### Publishing
First build the package then run ```npm publish```
### Consuming
Navigate to the folder of your consuming project and run one of the following commands.
_published:_
```
npm install @ --save
```
_unPublished (not recommended):_
```
npm install PATH_TO_GENERATED_PACKAGE --save
```
### Usage
Below code snippet shows exemplary usage of the configuration and the API based
on the typical `PetStore` example used for OpenAPI.
```
import * as your_api from 'your_api_package'
// Covers all auth methods included in your OpenAPI yaml definition
const authConfig: your_api.AuthMethodsConfiguration = {
"api_key": "YOUR_API_KEY"
}
// Implements a simple middleware to modify requests before (`pre`) they are sent
// and after (`post`) they have been received
class Test implements your_api.Middleware {
pre(context: your_api.RequestContext): Promise<your_api.RequestContext> {
// Modify context here and return
return Promise.resolve(context);
}
post(context: your_api.ResponseContext): Promise<your_api.ResponseContext> {
return Promise.resolve(context);
}
}
// Create configuration parameter object
const configurationParameters = {
httpApi: new your_api.JQueryHttpLibrary(), // Can also be ignored - default is usually fine
baseServer: your_api.servers[0], // First server is default
authMethods: authConfig, // No auth is default
promiseMiddleware: [new Test()],
}
// Convert to actual configuration
const config = your_api.createConfiguration(configurationParameters);
// Use configuration with your_api
const api = new your_api.PetApi(config);
your_api.Pet p = new your_api.Pet();
p.name = "My new pet";
p.photoUrls = [];
p.tags = [];
p.status = "available";
Promise<your_api.Pet> createdPet = api.addPet(p);
```

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,719 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
import { IoArgoprojWorkflowV1alpha1LabelKeys } from '../models/IoArgoprojWorkflowV1alpha1LabelKeys';
import { IoArgoprojWorkflowV1alpha1LabelValues } from '../models/IoArgoprojWorkflowV1alpha1LabelValues';
import { IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest } from '../models/IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest';
import { IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest } from '../models/IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest';
import { IoArgoprojWorkflowV1alpha1Workflow } from '../models/IoArgoprojWorkflowV1alpha1Workflow';
import { IoArgoprojWorkflowV1alpha1WorkflowList } from '../models/IoArgoprojWorkflowV1alpha1WorkflowList';
/**
* no description
*/
export class ArchivedWorkflowServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* @param uid
* @param namespace
*/
public async archivedWorkflowServiceDeleteArchivedWorkflow(uid: string, namespace?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'uid' is not null or undefined
if (uid === null || uid === undefined) {
throw new RequiredError("ArchivedWorkflowServiceApi", "archivedWorkflowServiceDeleteArchivedWorkflow", "uid");
}
// Path Params
const localVarPath = '/api/v1/archived-workflows/{uid}'
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (namespace !== undefined) {
requestContext.setQueryParam("namespace", ObjectSerializer.serialize(namespace, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param uid
* @param namespace
* @param name
*/
public async archivedWorkflowServiceGetArchivedWorkflow(uid: string, namespace?: string, name?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'uid' is not null or undefined
if (uid === null || uid === undefined) {
throw new RequiredError("ArchivedWorkflowServiceApi", "archivedWorkflowServiceGetArchivedWorkflow", "uid");
}
// Path Params
const localVarPath = '/api/v1/archived-workflows/{uid}'
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (namespace !== undefined) {
requestContext.setQueryParam("namespace", ObjectSerializer.serialize(namespace, "string", ""));
}
// Query Params
if (name !== undefined) {
requestContext.setQueryParam("name", ObjectSerializer.serialize(name, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
*/
public async archivedWorkflowServiceListArchivedWorkflowLabelKeys(namespace?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// Path Params
const localVarPath = '/api/v1/archived-workflows-label-keys';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (namespace !== undefined) {
requestContext.setQueryParam("namespace", ObjectSerializer.serialize(namespace, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
* @param namespace
*/
public async archivedWorkflowServiceListArchivedWorkflowLabelValues(listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, namespace?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// Path Params
const localVarPath = '/api/v1/archived-workflows-label-values';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
// Query Params
if (namespace !== undefined) {
requestContext.setQueryParam("namespace", ObjectSerializer.serialize(namespace, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
* @param namePrefix
* @param namespace
*/
public async archivedWorkflowServiceListArchivedWorkflows(listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, namePrefix?: string, namespace?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// Path Params
const localVarPath = '/api/v1/archived-workflows';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
// Query Params
if (namePrefix !== undefined) {
requestContext.setQueryParam("namePrefix", ObjectSerializer.serialize(namePrefix, "string", ""));
}
// Query Params
if (namespace !== undefined) {
requestContext.setQueryParam("namespace", ObjectSerializer.serialize(namespace, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param uid
* @param body
*/
public async archivedWorkflowServiceResubmitArchivedWorkflow(uid: string, body: IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'uid' is not null or undefined
if (uid === null || uid === undefined) {
throw new RequiredError("ArchivedWorkflowServiceApi", "archivedWorkflowServiceResubmitArchivedWorkflow", "uid");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("ArchivedWorkflowServiceApi", "archivedWorkflowServiceResubmitArchivedWorkflow", "body");
}
// Path Params
const localVarPath = '/api/v1/archived-workflows/{uid}/resubmit'
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param uid
* @param body
*/
public async archivedWorkflowServiceRetryArchivedWorkflow(uid: string, body: IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'uid' is not null or undefined
if (uid === null || uid === undefined) {
throw new RequiredError("ArchivedWorkflowServiceApi", "archivedWorkflowServiceRetryArchivedWorkflow", "uid");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("ArchivedWorkflowServiceApi", "archivedWorkflowServiceRetryArchivedWorkflow", "body");
}
// Path Params
const localVarPath = '/api/v1/archived-workflows/{uid}/retry'
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1RetryArchivedWorkflowRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class ArchivedWorkflowServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to archivedWorkflowServiceDeleteArchivedWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async archivedWorkflowServiceDeleteArchivedWorkflow(response: ResponseContext): Promise<any > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to archivedWorkflowServiceGetArchivedWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async archivedWorkflowServiceGetArchivedWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1Workflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1Workflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1Workflow", ""
) as IoArgoprojWorkflowV1alpha1Workflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1Workflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1Workflow", ""
) as IoArgoprojWorkflowV1alpha1Workflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to archivedWorkflowServiceListArchivedWorkflowLabelKeys
* @throws ApiException if the response code was not in [200, 299]
*/
public async archivedWorkflowServiceListArchivedWorkflowLabelKeys(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1LabelKeys > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1LabelKeys = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1LabelKeys", ""
) as IoArgoprojWorkflowV1alpha1LabelKeys;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1LabelKeys = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1LabelKeys", ""
) as IoArgoprojWorkflowV1alpha1LabelKeys;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to archivedWorkflowServiceListArchivedWorkflowLabelValues
* @throws ApiException if the response code was not in [200, 299]
*/
public async archivedWorkflowServiceListArchivedWorkflowLabelValues(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1LabelValues > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1LabelValues = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1LabelValues", ""
) as IoArgoprojWorkflowV1alpha1LabelValues;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1LabelValues = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1LabelValues", ""
) as IoArgoprojWorkflowV1alpha1LabelValues;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to archivedWorkflowServiceListArchivedWorkflows
* @throws ApiException if the response code was not in [200, 299]
*/
public async archivedWorkflowServiceListArchivedWorkflows(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1WorkflowList > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1WorkflowList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowList", ""
) as IoArgoprojWorkflowV1alpha1WorkflowList;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1WorkflowList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowList", ""
) as IoArgoprojWorkflowV1alpha1WorkflowList;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to archivedWorkflowServiceResubmitArchivedWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async archivedWorkflowServiceResubmitArchivedWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1Workflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1Workflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1Workflow", ""
) as IoArgoprojWorkflowV1alpha1Workflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1Workflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1Workflow", ""
) as IoArgoprojWorkflowV1alpha1Workflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to archivedWorkflowServiceRetryArchivedWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async archivedWorkflowServiceRetryArchivedWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1Workflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1Workflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1Workflow", ""
) as IoArgoprojWorkflowV1alpha1Workflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1Workflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1Workflow", ""
) as IoArgoprojWorkflowV1alpha1Workflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,492 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
/**
* no description
*/
export class ArtifactServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* Get an artifact.
* @param namespace
* @param idDiscriminator
* @param id
* @param nodeId
* @param artifactName
* @param artifactDiscriminator
*/
public async artifactServiceGetArtifactFile(namespace: string, idDiscriminator: 'workflow' | 'archived-workflows ', id: string, nodeId: string, artifactName: string, artifactDiscriminator: 'outputs', _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetArtifactFile", "namespace");
}
// verify required parameter 'idDiscriminator' is not null or undefined
if (idDiscriminator === null || idDiscriminator === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetArtifactFile", "idDiscriminator");
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetArtifactFile", "id");
}
// verify required parameter 'nodeId' is not null or undefined
if (nodeId === null || nodeId === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetArtifactFile", "nodeId");
}
// verify required parameter 'artifactName' is not null or undefined
if (artifactName === null || artifactName === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetArtifactFile", "artifactName");
}
// verify required parameter 'artifactDiscriminator' is not null or undefined
if (artifactDiscriminator === null || artifactDiscriminator === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetArtifactFile", "artifactDiscriminator");
}
// Path Params
const localVarPath = '/artifact-files/{namespace}/{idDiscriminator}/{id}/{nodeId}/{artifactDiscriminator}/{artifactName}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'idDiscriminator' + '}', encodeURIComponent(String(idDiscriminator)))
.replace('{' + 'id' + '}', encodeURIComponent(String(id)))
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)))
.replace('{' + 'artifactDiscriminator' + '}', encodeURIComponent(String(artifactDiscriminator)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* Get an input artifact.
* @param namespace
* @param name
* @param nodeId
* @param artifactName
*/
public async artifactServiceGetInputArtifact(namespace: string, name: string, nodeId: string, artifactName: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetInputArtifact", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetInputArtifact", "name");
}
// verify required parameter 'nodeId' is not null or undefined
if (nodeId === null || nodeId === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetInputArtifact", "nodeId");
}
// verify required parameter 'artifactName' is not null or undefined
if (artifactName === null || artifactName === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetInputArtifact", "artifactName");
}
// Path Params
const localVarPath = '/input-artifacts/{namespace}/{name}/{nodeId}/{artifactName}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* Get an input artifact by UID.
* @param uid
* @param nodeId
* @param artifactName
*/
public async artifactServiceGetInputArtifactByUID(uid: string, nodeId: string, artifactName: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'uid' is not null or undefined
if (uid === null || uid === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetInputArtifactByUID", "uid");
}
// verify required parameter 'nodeId' is not null or undefined
if (nodeId === null || nodeId === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetInputArtifactByUID", "nodeId");
}
// verify required parameter 'artifactName' is not null or undefined
if (artifactName === null || artifactName === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetInputArtifactByUID", "artifactName");
}
// Path Params
const localVarPath = '/input-artifacts-by-uid/{uid}/{nodeId}/{artifactName}'
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)))
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* Get an output artifact.
* @param namespace
* @param name
* @param nodeId
* @param artifactName
*/
public async artifactServiceGetOutputArtifact(namespace: string, name: string, nodeId: string, artifactName: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetOutputArtifact", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetOutputArtifact", "name");
}
// verify required parameter 'nodeId' is not null or undefined
if (nodeId === null || nodeId === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetOutputArtifact", "nodeId");
}
// verify required parameter 'artifactName' is not null or undefined
if (artifactName === null || artifactName === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetOutputArtifact", "artifactName");
}
// Path Params
const localVarPath = '/artifacts/{namespace}/{name}/{nodeId}/{artifactName}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* Get an output artifact by UID.
* @param uid
* @param nodeId
* @param artifactName
*/
public async artifactServiceGetOutputArtifactByUID(uid: string, nodeId: string, artifactName: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'uid' is not null or undefined
if (uid === null || uid === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetOutputArtifactByUID", "uid");
}
// verify required parameter 'nodeId' is not null or undefined
if (nodeId === null || nodeId === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetOutputArtifactByUID", "nodeId");
}
// verify required parameter 'artifactName' is not null or undefined
if (artifactName === null || artifactName === undefined) {
throw new RequiredError("ArtifactServiceApi", "artifactServiceGetOutputArtifactByUID", "artifactName");
}
// Path Params
const localVarPath = '/artifacts-by-uid/{uid}/{nodeId}/{artifactName}'
.replace('{' + 'uid' + '}', encodeURIComponent(String(uid)))
.replace('{' + 'nodeId' + '}', encodeURIComponent(String(nodeId)))
.replace('{' + 'artifactName' + '}', encodeURIComponent(String(artifactName)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class ArtifactServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to artifactServiceGetArtifactFile
* @throws ApiException if the response code was not in [200, 299]
*/
public async artifactServiceGetArtifactFile(response: ResponseContext): Promise<HttpFile > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: HttpFile = await response.getBodyAsFile() as any as HttpFile;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", "binary"
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: HttpFile = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"HttpFile", "binary"
) as HttpFile;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to artifactServiceGetInputArtifact
* @throws ApiException if the response code was not in [200, 299]
*/
public async artifactServiceGetInputArtifact(response: ResponseContext): Promise<HttpFile > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: HttpFile = await response.getBodyAsFile() as any as HttpFile;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", "binary"
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: HttpFile = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"HttpFile", "binary"
) as HttpFile;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to artifactServiceGetInputArtifactByUID
* @throws ApiException if the response code was not in [200, 299]
*/
public async artifactServiceGetInputArtifactByUID(response: ResponseContext): Promise<HttpFile > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: HttpFile = await response.getBodyAsFile() as any as HttpFile;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", "binary"
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: HttpFile = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"HttpFile", "binary"
) as HttpFile;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to artifactServiceGetOutputArtifact
* @throws ApiException if the response code was not in [200, 299]
*/
public async artifactServiceGetOutputArtifact(response: ResponseContext): Promise<HttpFile > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: HttpFile = await response.getBodyAsFile() as any as HttpFile;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", "binary"
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: HttpFile = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"HttpFile", "binary"
) as HttpFile;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to artifactServiceGetOutputArtifactByUID
* @throws ApiException if the response code was not in [200, 299]
*/
public async artifactServiceGetOutputArtifactByUID(response: ResponseContext): Promise<HttpFile > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: HttpFile = await response.getBodyAsFile() as any as HttpFile;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", "binary"
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: HttpFile = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"HttpFile", "binary"
) as HttpFile;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,601 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate } from '../models/IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate';
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest } from '../models/IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest';
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest } from '../models/IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest';
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList } from '../models/IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList';
import { IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest } from '../models/IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest';
/**
* no description
*/
export class ClusterWorkflowTemplateServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* @param body
*/
public async clusterWorkflowTemplateServiceCreateClusterWorkflowTemplate(body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("ClusterWorkflowTemplateServiceApi", "clusterWorkflowTemplateServiceCreateClusterWorkflowTemplate", "body");
}
// Path Params
const localVarPath = '/api/v1/cluster-workflow-templates';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateCreateRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param name
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object\&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \&#39;Orphan\&#39; - orphan the dependents; \&#39;Background\&#39; - allow the garbage collector to delete the dependents in the background; \&#39;Foreground\&#39; - a cascading policy that deletes all dependents in the foreground. +optional.
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
*/
public async clusterWorkflowTemplateServiceDeleteClusterWorkflowTemplate(name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("ClusterWorkflowTemplateServiceApi", "clusterWorkflowTemplateServiceDeleteClusterWorkflowTemplate", "name");
}
// Path Params
const localVarPath = '/api/v1/cluster-workflow-templates/{name}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (deleteOptionsGracePeriodSeconds !== undefined) {
requestContext.setQueryParam("deleteOptions.gracePeriodSeconds", ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string", "int64"));
}
// Query Params
if (deleteOptionsPreconditionsUid !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.uid", ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string", ""));
}
// Query Params
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.resourceVersion", ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string", ""));
}
// Query Params
if (deleteOptionsOrphanDependents !== undefined) {
requestContext.setQueryParam("deleteOptions.orphanDependents", ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean", ""));
}
// Query Params
if (deleteOptionsPropagationPolicy !== undefined) {
requestContext.setQueryParam("deleteOptions.propagationPolicy", ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string", ""));
}
// Query Params
if (deleteOptionsDryRun !== undefined) {
requestContext.setQueryParam("deleteOptions.dryRun", ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param name
* @param getOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
*/
public async clusterWorkflowTemplateServiceGetClusterWorkflowTemplate(name: string, getOptionsResourceVersion?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("ClusterWorkflowTemplateServiceApi", "clusterWorkflowTemplateServiceGetClusterWorkflowTemplate", "name");
}
// Path Params
const localVarPath = '/api/v1/cluster-workflow-templates/{name}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (getOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("getOptions.resourceVersion", ObjectSerializer.serialize(getOptionsResourceVersion, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param body
*/
public async clusterWorkflowTemplateServiceLintClusterWorkflowTemplate(body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("ClusterWorkflowTemplateServiceApi", "clusterWorkflowTemplateServiceLintClusterWorkflowTemplate", "body");
}
// Path Params
const localVarPath = '/api/v1/cluster-workflow-templates/lint';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateLintRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
*/
public async clusterWorkflowTemplateServiceListClusterWorkflowTemplates(listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// Path Params
const localVarPath = '/api/v1/cluster-workflow-templates';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param name DEPRECATED: This field is ignored.
* @param body
*/
public async clusterWorkflowTemplateServiceUpdateClusterWorkflowTemplate(name: string, body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("ClusterWorkflowTemplateServiceApi", "clusterWorkflowTemplateServiceUpdateClusterWorkflowTemplate", "name");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("ClusterWorkflowTemplateServiceApi", "clusterWorkflowTemplateServiceUpdateClusterWorkflowTemplate", "body");
}
// Path Params
const localVarPath = '/api/v1/cluster-workflow-templates/{name}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateUpdateRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class ClusterWorkflowTemplateServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to clusterWorkflowTemplateServiceCreateClusterWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async clusterWorkflowTemplateServiceCreateClusterWorkflowTemplate(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to clusterWorkflowTemplateServiceDeleteClusterWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async clusterWorkflowTemplateServiceDeleteClusterWorkflowTemplate(response: ResponseContext): Promise<any > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to clusterWorkflowTemplateServiceGetClusterWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async clusterWorkflowTemplateServiceGetClusterWorkflowTemplate(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to clusterWorkflowTemplateServiceLintClusterWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async clusterWorkflowTemplateServiceLintClusterWorkflowTemplate(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to clusterWorkflowTemplateServiceListClusterWorkflowTemplates
* @throws ApiException if the response code was not in [200, 299]
*/
public async clusterWorkflowTemplateServiceListClusterWorkflowTemplates(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplateList;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to clusterWorkflowTemplateServiceUpdateClusterWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async clusterWorkflowTemplateServiceUpdateClusterWorkflowTemplate(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1ClusterWorkflowTemplate;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,847 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
import { IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest } from '../models/IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest';
import { IoArgoprojWorkflowV1alpha1CronWorkflow } from '../models/IoArgoprojWorkflowV1alpha1CronWorkflow';
import { IoArgoprojWorkflowV1alpha1CronWorkflowList } from '../models/IoArgoprojWorkflowV1alpha1CronWorkflowList';
import { IoArgoprojWorkflowV1alpha1CronWorkflowResumeRequest } from '../models/IoArgoprojWorkflowV1alpha1CronWorkflowResumeRequest';
import { IoArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest } from '../models/IoArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest';
import { IoArgoprojWorkflowV1alpha1LintCronWorkflowRequest } from '../models/IoArgoprojWorkflowV1alpha1LintCronWorkflowRequest';
import { IoArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest } from '../models/IoArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest';
/**
* no description
*/
export class CronWorkflowServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* @param namespace
* @param body
*/
public async cronWorkflowServiceCreateCronWorkflow(namespace: string, body: IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceCreateCronWorkflow", "namespace");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceCreateCronWorkflow", "body");
}
// Path Params
const localVarPath = '/api/v1/cron-workflows/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object\&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \&#39;Orphan\&#39; - orphan the dependents; \&#39;Background\&#39; - allow the garbage collector to delete the dependents in the background; \&#39;Foreground\&#39; - a cascading policy that deletes all dependents in the foreground. +optional.
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
*/
public async cronWorkflowServiceDeleteCronWorkflow(namespace: string, name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceDeleteCronWorkflow", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceDeleteCronWorkflow", "name");
}
// Path Params
const localVarPath = '/api/v1/cron-workflows/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (deleteOptionsGracePeriodSeconds !== undefined) {
requestContext.setQueryParam("deleteOptions.gracePeriodSeconds", ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string", "int64"));
}
// Query Params
if (deleteOptionsPreconditionsUid !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.uid", ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string", ""));
}
// Query Params
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.resourceVersion", ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string", ""));
}
// Query Params
if (deleteOptionsOrphanDependents !== undefined) {
requestContext.setQueryParam("deleteOptions.orphanDependents", ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean", ""));
}
// Query Params
if (deleteOptionsPropagationPolicy !== undefined) {
requestContext.setQueryParam("deleteOptions.propagationPolicy", ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string", ""));
}
// Query Params
if (deleteOptionsDryRun !== undefined) {
requestContext.setQueryParam("deleteOptions.dryRun", ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param getOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
*/
public async cronWorkflowServiceGetCronWorkflow(namespace: string, name: string, getOptionsResourceVersion?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceGetCronWorkflow", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceGetCronWorkflow", "name");
}
// Path Params
const localVarPath = '/api/v1/cron-workflows/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (getOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("getOptions.resourceVersion", ObjectSerializer.serialize(getOptionsResourceVersion, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param body
*/
public async cronWorkflowServiceLintCronWorkflow(namespace: string, body: IoArgoprojWorkflowV1alpha1LintCronWorkflowRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceLintCronWorkflow", "namespace");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceLintCronWorkflow", "body");
}
// Path Params
const localVarPath = '/api/v1/cron-workflows/{namespace}/lint'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1LintCronWorkflowRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
*/
public async cronWorkflowServiceListCronWorkflows(namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceListCronWorkflows", "namespace");
}
// Path Params
const localVarPath = '/api/v1/cron-workflows/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param body
*/
public async cronWorkflowServiceResumeCronWorkflow(namespace: string, name: string, body: IoArgoprojWorkflowV1alpha1CronWorkflowResumeRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceResumeCronWorkflow", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceResumeCronWorkflow", "name");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceResumeCronWorkflow", "body");
}
// Path Params
const localVarPath = '/api/v1/cron-workflows/{namespace}/{name}/resume'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflowResumeRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param body
*/
public async cronWorkflowServiceSuspendCronWorkflow(namespace: string, name: string, body: IoArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceSuspendCronWorkflow", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceSuspendCronWorkflow", "name");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceSuspendCronWorkflow", "body");
}
// Path Params
const localVarPath = '/api/v1/cron-workflows/{namespace}/{name}/suspend'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1CronWorkflowSuspendRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name DEPRECATED: This field is ignored.
* @param body
*/
public async cronWorkflowServiceUpdateCronWorkflow(namespace: string, name: string, body: IoArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceUpdateCronWorkflow", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceUpdateCronWorkflow", "name");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("CronWorkflowServiceApi", "cronWorkflowServiceUpdateCronWorkflow", "body");
}
// Path Params
const localVarPath = '/api/v1/cron-workflows/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1UpdateCronWorkflowRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class CronWorkflowServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to cronWorkflowServiceCreateCronWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async cronWorkflowServiceCreateCronWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1CronWorkflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to cronWorkflowServiceDeleteCronWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async cronWorkflowServiceDeleteCronWorkflow(response: ResponseContext): Promise<any > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to cronWorkflowServiceGetCronWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async cronWorkflowServiceGetCronWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1CronWorkflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to cronWorkflowServiceLintCronWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async cronWorkflowServiceLintCronWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1CronWorkflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to cronWorkflowServiceListCronWorkflows
* @throws ApiException if the response code was not in [200, 299]
*/
public async cronWorkflowServiceListCronWorkflows(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1CronWorkflowList > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflowList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflowList", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflowList;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflowList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflowList", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflowList;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to cronWorkflowServiceResumeCronWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async cronWorkflowServiceResumeCronWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1CronWorkflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to cronWorkflowServiceSuspendCronWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async cronWorkflowServiceSuspendCronWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1CronWorkflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to cronWorkflowServiceUpdateCronWorkflow
* @throws ApiException if the response code was not in [200, 299]
*/
public async cronWorkflowServiceUpdateCronWorkflow(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1CronWorkflow > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1CronWorkflow = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1CronWorkflow", ""
) as IoArgoprojWorkflowV1alpha1CronWorkflow;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,256 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
import { IoArgoprojWorkflowV1alpha1WorkflowEventBindingList } from '../models/IoArgoprojWorkflowV1alpha1WorkflowEventBindingList';
/**
* no description
*/
export class EventServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* @param namespace
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
*/
public async eventServiceListWorkflowEventBindings(namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventServiceApi", "eventServiceListWorkflowEventBindings", "namespace");
}
// Path Params
const localVarPath = '/api/v1/workflow-event-bindings/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace The namespace for the io.argoproj.workflow.v1alpha1. This can be empty if the client has cluster scoped permissions. If empty, then the event is \&quot;broadcast\&quot; to workflow event binding in all namespaces.
* @param discriminator Optional discriminator for the io.argoproj.workflow.v1alpha1. This should almost always be empty. Used for edge-cases where the event payload alone is not provide enough information to discriminate the event. This MUST NOT be used as security mechanism, e.g. to allow two clients to use the same access token, or to support webhooks on unsecured server. Instead, use access tokens. This is made available as &#x60;discriminator&#x60; in the event binding selector (&#x60;/spec/event/selector)&#x60;
* @param body The event itself can be any data.
*/
public async eventServiceReceiveEvent(namespace: string, discriminator: string, body: any, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventServiceApi", "eventServiceReceiveEvent", "namespace");
}
// verify required parameter 'discriminator' is not null or undefined
if (discriminator === null || discriminator === undefined) {
throw new RequiredError("EventServiceApi", "eventServiceReceiveEvent", "discriminator");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("EventServiceApi", "eventServiceReceiveEvent", "body");
}
// Path Params
const localVarPath = '/api/v1/events/{namespace}/{discriminator}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'discriminator' + '}', encodeURIComponent(String(discriminator)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "any", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class EventServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventServiceListWorkflowEventBindings
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventServiceListWorkflowEventBindings(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1WorkflowEventBindingList > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1WorkflowEventBindingList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowEventBindingList", ""
) as IoArgoprojWorkflowV1alpha1WorkflowEventBindingList;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1WorkflowEventBindingList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowEventBindingList", ""
) as IoArgoprojWorkflowV1alpha1WorkflowEventBindingList;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventServiceReceiveEvent
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventServiceReceiveEvent(response: ResponseContext): Promise<any > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,858 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { EventsourceCreateEventSourceRequest } from '../models/EventsourceCreateEventSourceRequest';
import { EventsourceUpdateEventSourceRequest } from '../models/EventsourceUpdateEventSourceRequest';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
import { IoArgoprojEventsV1alpha1EventSource } from '../models/IoArgoprojEventsV1alpha1EventSource';
import { IoArgoprojEventsV1alpha1EventSourceList } from '../models/IoArgoprojEventsV1alpha1EventSourceList';
import { StreamResultOfEventsourceEventSourceWatchEvent } from '../models/StreamResultOfEventsourceEventSourceWatchEvent';
import { StreamResultOfEventsourceLogEntry } from '../models/StreamResultOfEventsourceLogEntry';
/**
* no description
*/
export class EventSourceServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* @param namespace
* @param body
*/
public async eventSourceServiceCreateEventSource(namespace: string, body: EventsourceCreateEventSourceRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceCreateEventSource", "namespace");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceCreateEventSource", "body");
}
// Path Params
const localVarPath = '/api/v1/event-sources/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "EventsourceCreateEventSourceRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object\&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \&#39;Orphan\&#39; - orphan the dependents; \&#39;Background\&#39; - allow the garbage collector to delete the dependents in the background; \&#39;Foreground\&#39; - a cascading policy that deletes all dependents in the foreground. +optional.
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
*/
public async eventSourceServiceDeleteEventSource(namespace: string, name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceDeleteEventSource", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceDeleteEventSource", "name");
}
// Path Params
const localVarPath = '/api/v1/event-sources/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (deleteOptionsGracePeriodSeconds !== undefined) {
requestContext.setQueryParam("deleteOptions.gracePeriodSeconds", ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string", "int64"));
}
// Query Params
if (deleteOptionsPreconditionsUid !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.uid", ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string", ""));
}
// Query Params
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.resourceVersion", ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string", ""));
}
// Query Params
if (deleteOptionsOrphanDependents !== undefined) {
requestContext.setQueryParam("deleteOptions.orphanDependents", ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean", ""));
}
// Query Params
if (deleteOptionsPropagationPolicy !== undefined) {
requestContext.setQueryParam("deleteOptions.propagationPolicy", ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string", ""));
}
// Query Params
if (deleteOptionsDryRun !== undefined) {
requestContext.setQueryParam("deleteOptions.dryRun", ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name optional - only return entries for this event source.
* @param eventSourceType optional - only return entries for this event source type (e.g. &#x60;webhook&#x60;).
* @param eventName optional - only return entries for this event name (e.g. &#x60;example&#x60;).
* @param grep optional - only return entries where &#x60;msg&#x60; matches this regular expression.
* @param podLogOptionsContainer The container for which to stream logs. Defaults to only container if there is one container in the pod. +optional.
* @param podLogOptionsFollow Follow the log stream of the pod. Defaults to false. +optional.
* @param podLogOptionsPrevious Return previous terminated container logs. Defaults to false. +optional.
* @param podLogOptionsSinceSeconds A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified. +optional.
* @param podLogOptionsSinceTimeSeconds Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
* @param podLogOptionsSinceTimeNanos Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.
* @param podLogOptionsTimestamps If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. +optional.
* @param podLogOptionsTailLines If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime +optional.
* @param podLogOptionsLimitBytes If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit. +optional.
* @param podLogOptionsInsecureSkipTLSVerifyBackend insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver\&#39;s TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet). +optional.
*/
public async eventSourceServiceEventSourcesLogs(namespace: string, name?: string, eventSourceType?: string, eventName?: string, grep?: string, podLogOptionsContainer?: string, podLogOptionsFollow?: boolean, podLogOptionsPrevious?: boolean, podLogOptionsSinceSeconds?: string, podLogOptionsSinceTimeSeconds?: string, podLogOptionsSinceTimeNanos?: number, podLogOptionsTimestamps?: boolean, podLogOptionsTailLines?: string, podLogOptionsLimitBytes?: string, podLogOptionsInsecureSkipTLSVerifyBackend?: boolean, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceEventSourcesLogs", "namespace");
}
// Path Params
const localVarPath = '/api/v1/stream/event-sources/{namespace}/logs'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (name !== undefined) {
requestContext.setQueryParam("name", ObjectSerializer.serialize(name, "string", ""));
}
// Query Params
if (eventSourceType !== undefined) {
requestContext.setQueryParam("eventSourceType", ObjectSerializer.serialize(eventSourceType, "string", ""));
}
// Query Params
if (eventName !== undefined) {
requestContext.setQueryParam("eventName", ObjectSerializer.serialize(eventName, "string", ""));
}
// Query Params
if (grep !== undefined) {
requestContext.setQueryParam("grep", ObjectSerializer.serialize(grep, "string", ""));
}
// Query Params
if (podLogOptionsContainer !== undefined) {
requestContext.setQueryParam("podLogOptions.container", ObjectSerializer.serialize(podLogOptionsContainer, "string", ""));
}
// Query Params
if (podLogOptionsFollow !== undefined) {
requestContext.setQueryParam("podLogOptions.follow", ObjectSerializer.serialize(podLogOptionsFollow, "boolean", ""));
}
// Query Params
if (podLogOptionsPrevious !== undefined) {
requestContext.setQueryParam("podLogOptions.previous", ObjectSerializer.serialize(podLogOptionsPrevious, "boolean", ""));
}
// Query Params
if (podLogOptionsSinceSeconds !== undefined) {
requestContext.setQueryParam("podLogOptions.sinceSeconds", ObjectSerializer.serialize(podLogOptionsSinceSeconds, "string", "int64"));
}
// Query Params
if (podLogOptionsSinceTimeSeconds !== undefined) {
requestContext.setQueryParam("podLogOptions.sinceTime.seconds", ObjectSerializer.serialize(podLogOptionsSinceTimeSeconds, "string", "int64"));
}
// Query Params
if (podLogOptionsSinceTimeNanos !== undefined) {
requestContext.setQueryParam("podLogOptions.sinceTime.nanos", ObjectSerializer.serialize(podLogOptionsSinceTimeNanos, "number", "int32"));
}
// Query Params
if (podLogOptionsTimestamps !== undefined) {
requestContext.setQueryParam("podLogOptions.timestamps", ObjectSerializer.serialize(podLogOptionsTimestamps, "boolean", ""));
}
// Query Params
if (podLogOptionsTailLines !== undefined) {
requestContext.setQueryParam("podLogOptions.tailLines", ObjectSerializer.serialize(podLogOptionsTailLines, "string", "int64"));
}
// Query Params
if (podLogOptionsLimitBytes !== undefined) {
requestContext.setQueryParam("podLogOptions.limitBytes", ObjectSerializer.serialize(podLogOptionsLimitBytes, "string", "int64"));
}
// Query Params
if (podLogOptionsInsecureSkipTLSVerifyBackend !== undefined) {
requestContext.setQueryParam("podLogOptions.insecureSkipTLSVerifyBackend", ObjectSerializer.serialize(podLogOptionsInsecureSkipTLSVerifyBackend, "boolean", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
*/
public async eventSourceServiceGetEventSource(namespace: string, name: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceGetEventSource", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceGetEventSource", "name");
}
// Path Params
const localVarPath = '/api/v1/event-sources/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
*/
public async eventSourceServiceListEventSources(namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceListEventSources", "namespace");
}
// Path Params
const localVarPath = '/api/v1/event-sources/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param body
*/
public async eventSourceServiceUpdateEventSource(namespace: string, name: string, body: EventsourceUpdateEventSourceRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceUpdateEventSource", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceUpdateEventSource", "name");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceUpdateEventSource", "body");
}
// Path Params
const localVarPath = '/api/v1/event-sources/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "EventsourceUpdateEventSourceRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
*/
public async eventSourceServiceWatchEventSources(namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("EventSourceServiceApi", "eventSourceServiceWatchEventSources", "namespace");
}
// Path Params
const localVarPath = '/api/v1/stream/event-sources/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class EventSourceServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventSourceServiceCreateEventSource
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventSourceServiceCreateEventSource(response: ResponseContext): Promise<IoArgoprojEventsV1alpha1EventSource > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojEventsV1alpha1EventSource = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1EventSource", ""
) as IoArgoprojEventsV1alpha1EventSource;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojEventsV1alpha1EventSource = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1EventSource", ""
) as IoArgoprojEventsV1alpha1EventSource;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventSourceServiceDeleteEventSource
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventSourceServiceDeleteEventSource(response: ResponseContext): Promise<any > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventSourceServiceEventSourcesLogs
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventSourceServiceEventSourcesLogs(response: ResponseContext): Promise<StreamResultOfEventsourceLogEntry > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: StreamResultOfEventsourceLogEntry = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"StreamResultOfEventsourceLogEntry", ""
) as StreamResultOfEventsourceLogEntry;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: StreamResultOfEventsourceLogEntry = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"StreamResultOfEventsourceLogEntry", ""
) as StreamResultOfEventsourceLogEntry;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventSourceServiceGetEventSource
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventSourceServiceGetEventSource(response: ResponseContext): Promise<IoArgoprojEventsV1alpha1EventSource > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojEventsV1alpha1EventSource = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1EventSource", ""
) as IoArgoprojEventsV1alpha1EventSource;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojEventsV1alpha1EventSource = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1EventSource", ""
) as IoArgoprojEventsV1alpha1EventSource;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventSourceServiceListEventSources
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventSourceServiceListEventSources(response: ResponseContext): Promise<IoArgoprojEventsV1alpha1EventSourceList > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojEventsV1alpha1EventSourceList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1EventSourceList", ""
) as IoArgoprojEventsV1alpha1EventSourceList;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojEventsV1alpha1EventSourceList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1EventSourceList", ""
) as IoArgoprojEventsV1alpha1EventSourceList;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventSourceServiceUpdateEventSource
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventSourceServiceUpdateEventSource(response: ResponseContext): Promise<IoArgoprojEventsV1alpha1EventSource > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojEventsV1alpha1EventSource = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1EventSource", ""
) as IoArgoprojEventsV1alpha1EventSource;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojEventsV1alpha1EventSource = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1EventSource", ""
) as IoArgoprojEventsV1alpha1EventSource;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to eventSourceServiceWatchEventSources
* @throws ApiException if the response code was not in [200, 299]
*/
public async eventSourceServiceWatchEventSources(response: ResponseContext): Promise<StreamResultOfEventsourceEventSourceWatchEvent > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: StreamResultOfEventsourceEventSourceWatchEvent = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"StreamResultOfEventsourceEventSourceWatchEvent", ""
) as StreamResultOfEventsourceEventSourceWatchEvent;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: StreamResultOfEventsourceEventSourceWatchEvent = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"StreamResultOfEventsourceEventSourceWatchEvent", ""
) as StreamResultOfEventsourceEventSourceWatchEvent;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,300 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
import { IoArgoprojWorkflowV1alpha1CollectEventRequest } from '../models/IoArgoprojWorkflowV1alpha1CollectEventRequest';
import { IoArgoprojWorkflowV1alpha1GetUserInfoResponse } from '../models/IoArgoprojWorkflowV1alpha1GetUserInfoResponse';
import { IoArgoprojWorkflowV1alpha1InfoResponse } from '../models/IoArgoprojWorkflowV1alpha1InfoResponse';
import { IoArgoprojWorkflowV1alpha1Version } from '../models/IoArgoprojWorkflowV1alpha1Version';
/**
* no description
*/
export class InfoServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* @param body
*/
public async infoServiceCollectEvent(body: IoArgoprojWorkflowV1alpha1CollectEventRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("InfoServiceApi", "infoServiceCollectEvent", "body");
}
// Path Params
const localVarPath = '/api/v1/tracking/event';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1CollectEventRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
*/
public async infoServiceGetInfo(_options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// Path Params
const localVarPath = '/api/v1/info';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
*/
public async infoServiceGetUserInfo(_options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// Path Params
const localVarPath = '/api/v1/userinfo';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
*/
public async infoServiceGetVersion(_options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// Path Params
const localVarPath = '/api/v1/version';
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class InfoServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to infoServiceCollectEvent
* @throws ApiException if the response code was not in [200, 299]
*/
public async infoServiceCollectEvent(response: ResponseContext): Promise<any > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to infoServiceGetInfo
* @throws ApiException if the response code was not in [200, 299]
*/
public async infoServiceGetInfo(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1InfoResponse > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1InfoResponse = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1InfoResponse", ""
) as IoArgoprojWorkflowV1alpha1InfoResponse;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1InfoResponse = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1InfoResponse", ""
) as IoArgoprojWorkflowV1alpha1InfoResponse;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to infoServiceGetUserInfo
* @throws ApiException if the response code was not in [200, 299]
*/
public async infoServiceGetUserInfo(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1GetUserInfoResponse > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1GetUserInfoResponse = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1GetUserInfoResponse", ""
) as IoArgoprojWorkflowV1alpha1GetUserInfoResponse;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1GetUserInfoResponse = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1GetUserInfoResponse", ""
) as IoArgoprojWorkflowV1alpha1GetUserInfoResponse;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to infoServiceGetVersion
* @throws ApiException if the response code was not in [200, 299]
*/
public async infoServiceGetVersion(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1Version > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1Version = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1Version", ""
) as IoArgoprojWorkflowV1alpha1Version;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1Version = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1Version", ""
) as IoArgoprojWorkflowV1alpha1Version;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,858 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
import { IoArgoprojEventsV1alpha1Sensor } from '../models/IoArgoprojEventsV1alpha1Sensor';
import { IoArgoprojEventsV1alpha1SensorList } from '../models/IoArgoprojEventsV1alpha1SensorList';
import { SensorCreateSensorRequest } from '../models/SensorCreateSensorRequest';
import { SensorUpdateSensorRequest } from '../models/SensorUpdateSensorRequest';
import { StreamResultOfSensorLogEntry } from '../models/StreamResultOfSensorLogEntry';
import { StreamResultOfSensorSensorWatchEvent } from '../models/StreamResultOfSensorSensorWatchEvent';
/**
* no description
*/
export class SensorServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* @param namespace
* @param body
*/
public async sensorServiceCreateSensor(namespace: string, body: SensorCreateSensorRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceCreateSensor", "namespace");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceCreateSensor", "body");
}
// Path Params
const localVarPath = '/api/v1/sensors/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "SensorCreateSensorRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object\&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \&#39;Orphan\&#39; - orphan the dependents; \&#39;Background\&#39; - allow the garbage collector to delete the dependents in the background; \&#39;Foreground\&#39; - a cascading policy that deletes all dependents in the foreground. +optional.
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
*/
public async sensorServiceDeleteSensor(namespace: string, name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceDeleteSensor", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceDeleteSensor", "name");
}
// Path Params
const localVarPath = '/api/v1/sensors/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (deleteOptionsGracePeriodSeconds !== undefined) {
requestContext.setQueryParam("deleteOptions.gracePeriodSeconds", ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string", "int64"));
}
// Query Params
if (deleteOptionsPreconditionsUid !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.uid", ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string", ""));
}
// Query Params
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.resourceVersion", ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string", ""));
}
// Query Params
if (deleteOptionsOrphanDependents !== undefined) {
requestContext.setQueryParam("deleteOptions.orphanDependents", ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean", ""));
}
// Query Params
if (deleteOptionsPropagationPolicy !== undefined) {
requestContext.setQueryParam("deleteOptions.propagationPolicy", ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string", ""));
}
// Query Params
if (deleteOptionsDryRun !== undefined) {
requestContext.setQueryParam("deleteOptions.dryRun", ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param getOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
*/
public async sensorServiceGetSensor(namespace: string, name: string, getOptionsResourceVersion?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceGetSensor", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceGetSensor", "name");
}
// Path Params
const localVarPath = '/api/v1/sensors/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (getOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("getOptions.resourceVersion", ObjectSerializer.serialize(getOptionsResourceVersion, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
*/
public async sensorServiceListSensors(namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceListSensors", "namespace");
}
// Path Params
const localVarPath = '/api/v1/sensors/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name optional - only return entries for this sensor name.
* @param triggerName optional - only return entries for this trigger.
* @param grep option - only return entries where &#x60;msg&#x60; contains this regular expressions.
* @param podLogOptionsContainer The container for which to stream logs. Defaults to only container if there is one container in the pod. +optional.
* @param podLogOptionsFollow Follow the log stream of the pod. Defaults to false. +optional.
* @param podLogOptionsPrevious Return previous terminated container logs. Defaults to false. +optional.
* @param podLogOptionsSinceSeconds A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified. +optional.
* @param podLogOptionsSinceTimeSeconds Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
* @param podLogOptionsSinceTimeNanos Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.
* @param podLogOptionsTimestamps If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. +optional.
* @param podLogOptionsTailLines If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime +optional.
* @param podLogOptionsLimitBytes If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit. +optional.
* @param podLogOptionsInsecureSkipTLSVerifyBackend insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver\&#39;s TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet). +optional.
*/
public async sensorServiceSensorsLogs(namespace: string, name?: string, triggerName?: string, grep?: string, podLogOptionsContainer?: string, podLogOptionsFollow?: boolean, podLogOptionsPrevious?: boolean, podLogOptionsSinceSeconds?: string, podLogOptionsSinceTimeSeconds?: string, podLogOptionsSinceTimeNanos?: number, podLogOptionsTimestamps?: boolean, podLogOptionsTailLines?: string, podLogOptionsLimitBytes?: string, podLogOptionsInsecureSkipTLSVerifyBackend?: boolean, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceSensorsLogs", "namespace");
}
// Path Params
const localVarPath = '/api/v1/stream/sensors/{namespace}/logs'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (name !== undefined) {
requestContext.setQueryParam("name", ObjectSerializer.serialize(name, "string", ""));
}
// Query Params
if (triggerName !== undefined) {
requestContext.setQueryParam("triggerName", ObjectSerializer.serialize(triggerName, "string", ""));
}
// Query Params
if (grep !== undefined) {
requestContext.setQueryParam("grep", ObjectSerializer.serialize(grep, "string", ""));
}
// Query Params
if (podLogOptionsContainer !== undefined) {
requestContext.setQueryParam("podLogOptions.container", ObjectSerializer.serialize(podLogOptionsContainer, "string", ""));
}
// Query Params
if (podLogOptionsFollow !== undefined) {
requestContext.setQueryParam("podLogOptions.follow", ObjectSerializer.serialize(podLogOptionsFollow, "boolean", ""));
}
// Query Params
if (podLogOptionsPrevious !== undefined) {
requestContext.setQueryParam("podLogOptions.previous", ObjectSerializer.serialize(podLogOptionsPrevious, "boolean", ""));
}
// Query Params
if (podLogOptionsSinceSeconds !== undefined) {
requestContext.setQueryParam("podLogOptions.sinceSeconds", ObjectSerializer.serialize(podLogOptionsSinceSeconds, "string", "int64"));
}
// Query Params
if (podLogOptionsSinceTimeSeconds !== undefined) {
requestContext.setQueryParam("podLogOptions.sinceTime.seconds", ObjectSerializer.serialize(podLogOptionsSinceTimeSeconds, "string", "int64"));
}
// Query Params
if (podLogOptionsSinceTimeNanos !== undefined) {
requestContext.setQueryParam("podLogOptions.sinceTime.nanos", ObjectSerializer.serialize(podLogOptionsSinceTimeNanos, "number", "int32"));
}
// Query Params
if (podLogOptionsTimestamps !== undefined) {
requestContext.setQueryParam("podLogOptions.timestamps", ObjectSerializer.serialize(podLogOptionsTimestamps, "boolean", ""));
}
// Query Params
if (podLogOptionsTailLines !== undefined) {
requestContext.setQueryParam("podLogOptions.tailLines", ObjectSerializer.serialize(podLogOptionsTailLines, "string", "int64"));
}
// Query Params
if (podLogOptionsLimitBytes !== undefined) {
requestContext.setQueryParam("podLogOptions.limitBytes", ObjectSerializer.serialize(podLogOptionsLimitBytes, "string", "int64"));
}
// Query Params
if (podLogOptionsInsecureSkipTLSVerifyBackend !== undefined) {
requestContext.setQueryParam("podLogOptions.insecureSkipTLSVerifyBackend", ObjectSerializer.serialize(podLogOptionsInsecureSkipTLSVerifyBackend, "boolean", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param body
*/
public async sensorServiceUpdateSensor(namespace: string, name: string, body: SensorUpdateSensorRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceUpdateSensor", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceUpdateSensor", "name");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceUpdateSensor", "body");
}
// Path Params
const localVarPath = '/api/v1/sensors/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "SensorUpdateSensorRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
*/
public async sensorServiceWatchSensors(namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("SensorServiceApi", "sensorServiceWatchSensors", "namespace");
}
// Path Params
const localVarPath = '/api/v1/stream/sensors/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class SensorServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to sensorServiceCreateSensor
* @throws ApiException if the response code was not in [200, 299]
*/
public async sensorServiceCreateSensor(response: ResponseContext): Promise<IoArgoprojEventsV1alpha1Sensor > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojEventsV1alpha1Sensor = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1Sensor", ""
) as IoArgoprojEventsV1alpha1Sensor;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojEventsV1alpha1Sensor = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1Sensor", ""
) as IoArgoprojEventsV1alpha1Sensor;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to sensorServiceDeleteSensor
* @throws ApiException if the response code was not in [200, 299]
*/
public async sensorServiceDeleteSensor(response: ResponseContext): Promise<any > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to sensorServiceGetSensor
* @throws ApiException if the response code was not in [200, 299]
*/
public async sensorServiceGetSensor(response: ResponseContext): Promise<IoArgoprojEventsV1alpha1Sensor > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojEventsV1alpha1Sensor = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1Sensor", ""
) as IoArgoprojEventsV1alpha1Sensor;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojEventsV1alpha1Sensor = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1Sensor", ""
) as IoArgoprojEventsV1alpha1Sensor;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to sensorServiceListSensors
* @throws ApiException if the response code was not in [200, 299]
*/
public async sensorServiceListSensors(response: ResponseContext): Promise<IoArgoprojEventsV1alpha1SensorList > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojEventsV1alpha1SensorList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1SensorList", ""
) as IoArgoprojEventsV1alpha1SensorList;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojEventsV1alpha1SensorList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1SensorList", ""
) as IoArgoprojEventsV1alpha1SensorList;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to sensorServiceSensorsLogs
* @throws ApiException if the response code was not in [200, 299]
*/
public async sensorServiceSensorsLogs(response: ResponseContext): Promise<StreamResultOfSensorLogEntry > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: StreamResultOfSensorLogEntry = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"StreamResultOfSensorLogEntry", ""
) as StreamResultOfSensorLogEntry;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: StreamResultOfSensorLogEntry = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"StreamResultOfSensorLogEntry", ""
) as StreamResultOfSensorLogEntry;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to sensorServiceUpdateSensor
* @throws ApiException if the response code was not in [200, 299]
*/
public async sensorServiceUpdateSensor(response: ResponseContext): Promise<IoArgoprojEventsV1alpha1Sensor > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojEventsV1alpha1Sensor = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1Sensor", ""
) as IoArgoprojEventsV1alpha1Sensor;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojEventsV1alpha1Sensor = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojEventsV1alpha1Sensor", ""
) as IoArgoprojEventsV1alpha1Sensor;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to sensorServiceWatchSensors
* @throws ApiException if the response code was not in [200, 299]
*/
public async sensorServiceWatchSensors(response: ResponseContext): Promise<StreamResultOfSensorSensorWatchEvent > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: StreamResultOfSensorSensorWatchEvent = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"StreamResultOfSensorSensorWatchEvent", ""
) as StreamResultOfSensorSensorWatchEvent;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: StreamResultOfSensorSensorWatchEvent = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"StreamResultOfSensorSensorWatchEvent", ""
) as StreamResultOfSensorSensorWatchEvent;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,649 +0,0 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import {canConsumeForm, isCodeInRange} from '../util';
import {SecurityAuthentication} from '../auth/auth';
import { GrpcGatewayRuntimeError } from '../models/GrpcGatewayRuntimeError';
import { IoArgoprojWorkflowV1alpha1WorkflowTemplate } from '../models/IoArgoprojWorkflowV1alpha1WorkflowTemplate';
import { IoArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest } from '../models/IoArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest';
import { IoArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest } from '../models/IoArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest';
import { IoArgoprojWorkflowV1alpha1WorkflowTemplateList } from '../models/IoArgoprojWorkflowV1alpha1WorkflowTemplateList';
import { IoArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest } from '../models/IoArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest';
/**
* no description
*/
export class WorkflowTemplateServiceApiRequestFactory extends BaseAPIRequestFactory {
/**
* @param namespace
* @param body
*/
public async workflowTemplateServiceCreateWorkflowTemplate(namespace: string, body: IoArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceCreateWorkflowTemplate", "namespace");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceCreateWorkflowTemplate", "body");
}
// Path Params
const localVarPath = '/api/v1/workflow-templates/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplateCreateRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param deleteOptionsGracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. +optional.
* @param deleteOptionsPreconditionsUid Specifies the target UID. +optional.
* @param deleteOptionsPreconditionsResourceVersion Specifies the target ResourceVersion +optional.
* @param deleteOptionsOrphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object\&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both. +optional.
* @param deleteOptionsPropagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \&#39;Orphan\&#39; - orphan the dependents; \&#39;Background\&#39; - allow the garbage collector to delete the dependents in the background; \&#39;Foreground\&#39; - a cascading policy that deletes all dependents in the foreground. +optional.
* @param deleteOptionsDryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed +optional.
*/
public async workflowTemplateServiceDeleteWorkflowTemplate(namespace: string, name: string, deleteOptionsGracePeriodSeconds?: string, deleteOptionsPreconditionsUid?: string, deleteOptionsPreconditionsResourceVersion?: string, deleteOptionsOrphanDependents?: boolean, deleteOptionsPropagationPolicy?: string, deleteOptionsDryRun?: Array<string>, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceDeleteWorkflowTemplate", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceDeleteWorkflowTemplate", "name");
}
// Path Params
const localVarPath = '/api/v1/workflow-templates/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (deleteOptionsGracePeriodSeconds !== undefined) {
requestContext.setQueryParam("deleteOptions.gracePeriodSeconds", ObjectSerializer.serialize(deleteOptionsGracePeriodSeconds, "string", "int64"));
}
// Query Params
if (deleteOptionsPreconditionsUid !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.uid", ObjectSerializer.serialize(deleteOptionsPreconditionsUid, "string", ""));
}
// Query Params
if (deleteOptionsPreconditionsResourceVersion !== undefined) {
requestContext.setQueryParam("deleteOptions.preconditions.resourceVersion", ObjectSerializer.serialize(deleteOptionsPreconditionsResourceVersion, "string", ""));
}
// Query Params
if (deleteOptionsOrphanDependents !== undefined) {
requestContext.setQueryParam("deleteOptions.orphanDependents", ObjectSerializer.serialize(deleteOptionsOrphanDependents, "boolean", ""));
}
// Query Params
if (deleteOptionsPropagationPolicy !== undefined) {
requestContext.setQueryParam("deleteOptions.propagationPolicy", ObjectSerializer.serialize(deleteOptionsPropagationPolicy, "string", ""));
}
// Query Params
if (deleteOptionsDryRun !== undefined) {
requestContext.setQueryParam("deleteOptions.dryRun", ObjectSerializer.serialize(deleteOptionsDryRun, "Array<string>", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name
* @param getOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
*/
public async workflowTemplateServiceGetWorkflowTemplate(namespace: string, name: string, getOptionsResourceVersion?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceGetWorkflowTemplate", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceGetWorkflowTemplate", "name");
}
// Path Params
const localVarPath = '/api/v1/workflow-templates/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (getOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("getOptions.resourceVersion", ObjectSerializer.serialize(getOptionsResourceVersion, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param body
*/
public async workflowTemplateServiceLintWorkflowTemplate(namespace: string, body: IoArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceLintWorkflowTemplate", "namespace");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceLintWorkflowTemplate", "body");
}
// Path Params
const localVarPath = '/api/v1/workflow-templates/{namespace}/lint'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplateLintRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param listOptionsLabelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. +optional.
* @param listOptionsFieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. +optional.
* @param listOptionsWatch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. +optional.
* @param listOptionsAllowWatchBookmarks allowWatchBookmarks requests watch events with type \&quot;BOOKMARK\&quot;. Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\&#39;s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. +optional.
* @param listOptionsResourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsResourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset +optional
* @param listOptionsTimeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. +optional.
* @param listOptionsLimit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
* @param listOptionsContinue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \&quot;next key\&quot;. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
*/
public async workflowTemplateServiceListWorkflowTemplates(namespace: string, listOptionsLabelSelector?: string, listOptionsFieldSelector?: string, listOptionsWatch?: boolean, listOptionsAllowWatchBookmarks?: boolean, listOptionsResourceVersion?: string, listOptionsResourceVersionMatch?: string, listOptionsTimeoutSeconds?: string, listOptionsLimit?: string, listOptionsContinue?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceListWorkflowTemplates", "namespace");
}
// Path Params
const localVarPath = '/api/v1/workflow-templates/{namespace}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params
if (listOptionsLabelSelector !== undefined) {
requestContext.setQueryParam("listOptions.labelSelector", ObjectSerializer.serialize(listOptionsLabelSelector, "string", ""));
}
// Query Params
if (listOptionsFieldSelector !== undefined) {
requestContext.setQueryParam("listOptions.fieldSelector", ObjectSerializer.serialize(listOptionsFieldSelector, "string", ""));
}
// Query Params
if (listOptionsWatch !== undefined) {
requestContext.setQueryParam("listOptions.watch", ObjectSerializer.serialize(listOptionsWatch, "boolean", ""));
}
// Query Params
if (listOptionsAllowWatchBookmarks !== undefined) {
requestContext.setQueryParam("listOptions.allowWatchBookmarks", ObjectSerializer.serialize(listOptionsAllowWatchBookmarks, "boolean", ""));
}
// Query Params
if (listOptionsResourceVersion !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersion", ObjectSerializer.serialize(listOptionsResourceVersion, "string", ""));
}
// Query Params
if (listOptionsResourceVersionMatch !== undefined) {
requestContext.setQueryParam("listOptions.resourceVersionMatch", ObjectSerializer.serialize(listOptionsResourceVersionMatch, "string", ""));
}
// Query Params
if (listOptionsTimeoutSeconds !== undefined) {
requestContext.setQueryParam("listOptions.timeoutSeconds", ObjectSerializer.serialize(listOptionsTimeoutSeconds, "string", "int64"));
}
// Query Params
if (listOptionsLimit !== undefined) {
requestContext.setQueryParam("listOptions.limit", ObjectSerializer.serialize(listOptionsLimit, "string", "int64"));
}
// Query Params
if (listOptionsContinue !== undefined) {
requestContext.setQueryParam("listOptions.continue", ObjectSerializer.serialize(listOptionsContinue, "string", ""));
}
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
/**
* @param namespace
* @param name DEPRECATED: This field is ignored.
* @param body
*/
public async workflowTemplateServiceUpdateWorkflowTemplate(namespace: string, name: string, body: IoArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
// verify required parameter 'namespace' is not null or undefined
if (namespace === null || namespace === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceUpdateWorkflowTemplate", "namespace");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceUpdateWorkflowTemplate", "name");
}
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("WorkflowTemplateServiceApi", "workflowTemplateServiceUpdateWorkflowTemplate", "body");
}
// Path Params
const localVarPath = '/api/v1/workflow-templates/{namespace}/{name}'
.replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
// Make Request Context
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json"
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "IoArgoprojWorkflowV1alpha1WorkflowTemplateUpdateRequest", ""),
contentType
);
requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined;
// Apply auth methods
authMethod = _config.authMethods["BearerToken"]
if (authMethod?.applySecurityAuthentication) {
await authMethod?.applySecurityAuthentication(requestContext);
}
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
if (defaultAuth?.applySecurityAuthentication) {
await defaultAuth?.applySecurityAuthentication(requestContext);
}
return requestContext;
}
}
export class WorkflowTemplateServiceApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to workflowTemplateServiceCreateWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async workflowTemplateServiceCreateWorkflowTemplate(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1WorkflowTemplate > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplate;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplate;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to workflowTemplateServiceDeleteWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async workflowTemplateServiceDeleteWorkflowTemplate(response: ResponseContext): Promise<any > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: any = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"any", ""
) as any;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to workflowTemplateServiceGetWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async workflowTemplateServiceGetWorkflowTemplate(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1WorkflowTemplate > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplate;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplate;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to workflowTemplateServiceLintWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async workflowTemplateServiceLintWorkflowTemplate(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1WorkflowTemplate > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplate;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplate;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to workflowTemplateServiceListWorkflowTemplates
* @throws ApiException if the response code was not in [200, 299]
*/
public async workflowTemplateServiceListWorkflowTemplates(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1WorkflowTemplateList > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplateList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplateList", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplateList;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplateList = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplateList", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplateList;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to workflowTemplateServiceUpdateWorkflowTemplate
* @throws ApiException if the response code was not in [200, 299]
*/
public async workflowTemplateServiceUpdateWorkflowTemplate(response: ResponseContext): Promise<IoArgoprojWorkflowV1alpha1WorkflowTemplate > {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplate;
return body;
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: GrpcGatewayRuntimeError = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"GrpcGatewayRuntimeError", ""
) as GrpcGatewayRuntimeError;
throw new ApiException<GrpcGatewayRuntimeError>(response.httpStatusCode, "An unexpected error response.", body, response.headers);
}
// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: IoArgoprojWorkflowV1alpha1WorkflowTemplate = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"IoArgoprojWorkflowV1alpha1WorkflowTemplate", ""
) as IoArgoprojWorkflowV1alpha1WorkflowTemplate;
return body;
}
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
}
}

View file

@ -1,37 +0,0 @@
import { Configuration } from '../configuration'
/**
*
* @export
*/
export const COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
/**
*
* @export
* @class BaseAPI
*/
export class BaseAPIRequestFactory {
constructor(protected configuration: Configuration) {
}
};
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public api: string, public method: string, public field: string) {
super("Required parameter " + field + " was null or undefined when calling " + api + "." + method + ".");
}
}

View file

@ -1,15 +0,0 @@
/**
* Represents an error caused by an api call i.e. it has attributes for a HTTP status code
* and the returned body object.
*
* Example
* API returns a ErrorMessageObject whenever HTTP status code is not in [200, 299]
* => ApiException(404, someErrorMessageObject)
*
*/
export class ApiException<T> extends Error {
public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) {
super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " +
JSON.stringify(headers))
}
}

View file

@ -1,79 +0,0 @@
import { RequestContext } from "../http/http";
/**
* Interface authentication schemes.
*/
export interface SecurityAuthentication {
/*
* @return returns the name of the security authentication as specified in OAI
*/
getName(): string;
/**
* Applies the authentication scheme to the request context
*
* @params context the request context which should use this authentication scheme
*/
applySecurityAuthentication(context: RequestContext): void | Promise<void>;
}
export interface TokenProvider {
getToken(): Promise<string> | string;
}
/**
* Applies apiKey authentication to the request context.
*/
export class BearerTokenAuthentication implements SecurityAuthentication {
/**
* Configures this api key authentication with the necessary properties
*
* @param apiKey: The api key to be used for every request
*/
public constructor(private apiKey: string) {}
public getName(): string {
return "BearerToken";
}
public applySecurityAuthentication(context: RequestContext) {
context.setHeaderParam("Authorization", this.apiKey);
}
}
export type AuthMethods = {
"default"?: SecurityAuthentication,
"BearerToken"?: SecurityAuthentication
}
export type ApiKeyConfiguration = string;
export type HttpBasicConfiguration = { "username": string, "password": string };
export type HttpBearerConfiguration = { tokenProvider: TokenProvider };
export type OAuth2Configuration = { accessToken: string };
export type AuthMethodsConfiguration = {
"default"?: SecurityAuthentication,
"BearerToken"?: ApiKeyConfiguration
}
/**
* Creates the authentication methods from a swagger description.
*
*/
export function configureAuthMethods(config: AuthMethodsConfiguration | undefined): AuthMethods {
let authMethods: AuthMethods = {}
if (!config) {
return authMethods;
}
authMethods["default"] = config["default"]
if (config["BearerToken"]) {
authMethods["BearerToken"] = new BearerTokenAuthentication(
config["BearerToken"]
);
}
return authMethods;
}

View file

@ -1,82 +0,0 @@
import { HttpLibrary } from "./http/http";
import { Middleware, PromiseMiddleware, PromiseMiddlewareWrapper } from "./middleware";
import { IsomorphicFetchHttpLibrary as DefaultHttpLibrary } from "./http/isomorphic-fetch";
import { BaseServerConfiguration, server1 } from "./servers";
import { configureAuthMethods, AuthMethods, AuthMethodsConfiguration } from "./auth/auth";
export interface Configuration {
readonly baseServer: BaseServerConfiguration;
readonly httpApi: HttpLibrary;
readonly middleware: Middleware[];
readonly authMethods: AuthMethods;
}
/**
* Interface with which a configuration object can be configured.
*/
export interface ConfigurationParameters {
/**
* Default server to use - a list of available servers (according to the
* OpenAPI yaml definition) is included in the `servers` const in `./servers`. You can also
* create your own server with the `ServerConfiguration` class from the same
* file.
*/
baseServer?: BaseServerConfiguration;
/**
* HTTP library to use e.g. IsomorphicFetch. This can usually be skipped as
* all generators come with a default library.
* If available, additional libraries can be imported from `./http/*`
*/
httpApi?: HttpLibrary;
/**
* The middlewares which will be applied to requests and responses. You can
* add any number of middleware components to modify requests before they
* are sent or before they are deserialized by implementing the `Middleware`
* interface defined in `./middleware`
*/
middleware?: Middleware[];
/**
* Configures middleware functions that return promises instead of
* Observables (which are used by `middleware`). Otherwise allows for the
* same functionality as `middleware`, i.e., modifying requests before they
* are sent and before they are deserialized.
*/
promiseMiddleware?: PromiseMiddleware[];
/**
* Configuration for the available authentication methods (e.g., api keys)
* according to the OpenAPI yaml definition. For the definition, please refer to
* `./auth/auth`
*/
authMethods?: AuthMethodsConfiguration
}
/**
* Provide your `ConfigurationParameters` to this function to get a `Configuration`
* object that can be used to configure your APIs (in the constructor or
* for each request individually).
*
* If a property is not included in conf, a default is used:
* - baseServer: server1
* - httpApi: IsomorphicFetchHttpLibrary
* - middleware: []
* - promiseMiddleware: []
* - authMethods: {}
*
* @param conf partial configuration
*/
export function createConfiguration(conf: ConfigurationParameters = {}): Configuration {
const configuration: Configuration = {
baseServer: conf.baseServer !== undefined ? conf.baseServer : server1,
httpApi: conf.httpApi || new DefaultHttpLibrary(),
middleware: conf.middleware || [],
authMethods: configureAuthMethods(conf.authMethods)
};
if (conf.promiseMiddleware) {
conf.promiseMiddleware.forEach(
m => configuration.middleware.push(new PromiseMiddlewareWrapper(m))
);
}
return configuration;
}

View file

@ -1,51 +0,0 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View file

@ -1,232 +0,0 @@
import { Observable, from } from '../rxjsStub';
export * from './isomorphic-fetch';
/**
* Represents an HTTP method.
*/
export enum HttpMethod {
GET = "GET",
HEAD = "HEAD",
POST = "POST",
PUT = "PUT",
DELETE = "DELETE",
CONNECT = "CONNECT",
OPTIONS = "OPTIONS",
TRACE = "TRACE",
PATCH = "PATCH"
}
/**
* Represents an HTTP file which will be transferred from or to a server.
*/
export type HttpFile = Blob & { readonly name: string };
export class HttpException extends Error {
public constructor(msg: string) {
super(msg);
}
}
/**
* Represents the body of an outgoing HTTP request.
*/
export type RequestBody = undefined | string | FormData | URLSearchParams;
/**
* Represents an HTTP request context
*/
export class RequestContext {
private headers: { [key: string]: string } = {};
private body: RequestBody = undefined;
private url: URL;
/**
* Creates the request context using a http method and request resource url
*
* @param url url of the requested resource
* @param httpMethod http method
*/
public constructor(url: string, private httpMethod: HttpMethod) {
this.url = new URL(url);
}
/*
* Returns the url set in the constructor including the query string
*
*/
public getUrl(): string {
return this.url.toString().endsWith("/") ?
this.url.toString().slice(0, -1)
: this.url.toString();
}
/**
* Replaces the url set in the constructor with this url.
*
*/
public setUrl(url: string) {
this.url = new URL(url);
}
/**
* Sets the body of the http request either as a string or FormData
*
* Note that setting a body on a HTTP GET, HEAD, DELETE, CONNECT or TRACE
* request is discouraged.
* https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#rfc.section.7.3.1
*
* @param body the body of the request
*/
public setBody(body: RequestBody) {
this.body = body;
}
public getHttpMethod(): HttpMethod {
return this.httpMethod;
}
public getHeaders(): { [key: string]: string } {
return this.headers;
}
public getBody(): RequestBody {
return this.body;
}
public setQueryParam(name: string, value: string) {
this.url.searchParams.set(name, value);
}
/**
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
*
*/
public addCookie(name: string, value: string): void {
if (!this.headers["Cookie"]) {
this.headers["Cookie"] = "";
}
this.headers["Cookie"] += name + "=" + value + "; ";
}
public setHeaderParam(key: string, value: string): void {
this.headers[key] = value;
}
}
export interface ResponseBody {
text(): Promise<string>;
binary(): Promise<Blob>;
}
/**
* Helper class to generate a `ResponseBody` from binary data
*/
export class SelfDecodingBody implements ResponseBody {
constructor(private dataSource: Promise<Blob>) {}
binary(): Promise<Blob> {
return this.dataSource;
}
async text(): Promise<string> {
const data: Blob = await this.dataSource;
// @ts-ignore
if (data.text) {
// @ts-ignore
return data.text();
}
return new Promise<string>((resolve, reject) => {
const reader = new FileReader();
reader.addEventListener("load", () => resolve(reader.result as string));
reader.addEventListener("error", () => reject(reader.error));
reader.readAsText(data);
});
}
}
export class ResponseContext {
public constructor(
public httpStatusCode: number,
public headers: { [key: string]: string },
public body: ResponseBody
) {}
/**
* Parse header value in the form `value; param1="value1"`
*
* E.g. for Content-Type or Content-Disposition
* Parameter names are converted to lower case
* The first parameter is returned with the key `""`
*/
public getParsedHeader(headerName: string): { [parameter: string]: string } {
const result: { [parameter: string]: string } = {};
if (!this.headers[headerName]) {
return result;
}
const parameters = this.headers[headerName].split(";");
for (const parameter of parameters) {
let [key, value] = parameter.split("=", 2);
key = key.toLowerCase().trim();
if (value === undefined) {
result[""] = key;
} else {
value = value.trim();
if (value.startsWith('"') && value.endsWith('"')) {
value = value.substring(1, value.length - 1);
}
result[key] = value;
}
}
return result;
}
public async getBodyAsFile(): Promise<HttpFile> {
const data = await this.body.binary();
const fileName = this.getParsedHeader("content-disposition")["filename"] || "";
const contentType = this.headers["content-type"] || "";
try {
return new File([data], fileName, { type: contentType });
} catch (error) {
/** Fallback for when the File constructor is not available */
return Object.assign(data, {
name: fileName,
type: contentType
});
}
}
/**
* Use a heuristic to get a body of unknown data structure.
* Return as string if possible, otherwise as binary.
*/
public getBodyAsAny(): Promise<string | Blob | undefined> {
try {
return this.body.text();
} catch {}
try {
return this.body.binary();
} catch {}
return Promise.resolve(undefined);
}
}
export interface HttpLibrary {
send(request: RequestContext): Observable<ResponseContext>;
}
export interface PromiseHttpLibrary {
send(request: RequestContext): Promise<ResponseContext>;
}
export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLibrary {
return {
send(request: RequestContext): Observable<ResponseContext> {
return from(promiseHttpLibrary.send(request));
}
}
}

View file

@ -1,32 +0,0 @@
import {HttpLibrary, RequestContext, ResponseContext} from './http';
import { from, Observable } from '../rxjsStub';
import "whatwg-fetch";
export class IsomorphicFetchHttpLibrary implements HttpLibrary {
public send(request: RequestContext): Observable<ResponseContext> {
let method = request.getHttpMethod().toString();
let body = request.getBody();
const resultPromise = fetch(request.getUrl(), {
method: method,
body: body as any,
headers: request.getHeaders(),
credentials: "same-origin"
}).then((resp: any) => {
const headers: { [name: string]: string } = {};
resp.headers.forEach((value: string, name: string) => {
headers[name] = value;
});
const body = {
text: () => resp.text(),
binary: () => resp.blob()
};
return new ResponseContext(resp.status, headers, body);
});
return from<Promise<ResponseContext>>(resultPromise);
}
}

View file

@ -1,12 +1 @@
export * from "./http/http";
export * from "./auth/auth";
export * from "./models/all";
export { createConfiguration } from "./configuration"
export { Configuration } from "./configuration"
export * from "./apis/exception";
export * from "./servers";
export { RequiredError } from "./apis/baseapi";
export { PromiseMiddleware as Middleware } from './middleware';
export { PromiseArchivedWorkflowServiceApi as ArchivedWorkflowServiceApi, PromiseArtifactServiceApi as ArtifactServiceApi, PromiseClusterWorkflowTemplateServiceApi as ClusterWorkflowTemplateServiceApi, PromiseCronWorkflowServiceApi as CronWorkflowServiceApi, PromiseEventServiceApi as EventServiceApi, PromiseEventSourceServiceApi as EventSourceServiceApi, PromiseInfoServiceApi as InfoServiceApi, PromiseSensorServiceApi as SensorServiceApi, PromiseWorkflowServiceApi as WorkflowServiceApi, PromiseWorkflowTemplateServiceApi as WorkflowTemplateServiceApi } from './types/PromiseAPI';

View file

@ -1,66 +0,0 @@
import {RequestContext, ResponseContext} from './http/http';
import { Observable, from } from './rxjsStub';
/**
* Defines the contract for a middleware intercepting requests before
* they are sent (but after the RequestContext was created)
* and before the ResponseContext is unwrapped.
*
*/
export interface Middleware {
/**
* Modifies the request before the request is sent.
*
* @param context RequestContext of a request which is about to be sent to the server
* @returns an observable of the updated request context
*
*/
pre(context: RequestContext): Observable<RequestContext>;
/**
* Modifies the returned response before it is deserialized.
*
* @param context ResponseContext of a sent request
* @returns an observable of the modified response context
*/
post(context: ResponseContext): Observable<ResponseContext>;
}
export class PromiseMiddlewareWrapper implements Middleware {
public constructor(private middleware: PromiseMiddleware) {
}
pre(context: RequestContext): Observable<RequestContext> {
return from(this.middleware.pre(context));
}
post(context: ResponseContext): Observable<ResponseContext> {
return from(this.middleware.post(context));
}
}
/**
* Defines the contract for a middleware intercepting requests before
* they are sent (but after the RequestContext was created)
* and before the ResponseContext is unwrapped.
*
*/
export interface PromiseMiddleware {
/**
* Modifies the request before the request is sent.
*
* @param context RequestContext of a request which is about to be sent to the server
* @returns an observable of the updated request context
*
*/
pre(context: RequestContext): Promise<RequestContext>;
/**
* Modifies the returned response before it is deserialized.
*
* @param context ResponseContext of a sent request
* @returns an observable of the modified response context
*/
post(context: ResponseContext): Promise<ResponseContext>;
}

View file

@ -1,36 +0,0 @@
{
"name": "",
"version": "",
"description": "OpenAPI client for ",
"author": "OpenAPI-Generator Contributors",
"repository": {
"type": "git",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
},
"keywords": [
"fetch",
"typescript",
"openapi-client",
"openapi-generator"
],
"license": "Unlicense",
"main": "./dist/index.js",
"type": "commonjs",
"exports": {
".": "./dist/index.js"
},
"typings": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"prepare": "npm run build"
},
"dependencies": {
"whatwg-fetch": "^3.0.0",
"es6-promise": "^4.2.4",
"url-parse": "^1.4.3"
},
"devDependencies": {
"typescript": "^4.0",
"@types/url-parse": "1.4.4"
}
}

View file

@ -1,27 +0,0 @@
export class Observable<T> {
constructor(private promise: Promise<T>) {}
toPromise() {
return this.promise;
}
pipe<S>(callback: (value: T) => S | Promise<S>): Observable<S> {
return new Observable(this.promise.then(callback));
}
}
export function from<T>(promise: Promise<any>) {
return new Observable(promise);
}
export function of<T>(value: T) {
return new Observable<T>(Promise.resolve(value));
}
export function mergeMap<T, S>(callback: (value: T) => Observable<S>) {
return (value: T) => callback(value).toPromise();
}
export function map(callback: any) {
return callback;
}

View file

@ -1,56 +0,0 @@
import { RequestContext, HttpMethod } from "./http/http";
export interface BaseServerConfiguration {
makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext;
}
/**
*
* Represents the configuration of a server including its
* url template and variable configuration based on the url.
*
*/
export class ServerConfiguration<T extends { [key: string]: string }> implements BaseServerConfiguration {
public constructor(private url: string, private variableConfiguration: T) {}
/**
* Sets the value of the variables of this server. Variables are included in
* the `url` of this ServerConfiguration in the form `{variableName}`
*
* @param variableConfiguration a partial variable configuration for the
* variables contained in the url
*/
public setVariables(variableConfiguration: Partial<T>) {
Object.assign(this.variableConfiguration, variableConfiguration);
}
public getConfiguration(): T {
return this.variableConfiguration
}
private getUrl() {
let replacedUrl = this.url;
for (const key in this.variableConfiguration) {
var re = new RegExp("{" + key + "}","g");
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
}
return replacedUrl
}
/**
* Creates a new request context for this server using the url with variables
* replaced with their respective values and the endpoint of the request appended.
*
* @param endpoint the endpoint to be queried on the server
* @param httpMethod httpMethod to be used
*
*/
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
return new RequestContext(this.getUrl() + endpoint, httpMethod);
}
}
export const server1 = new ServerConfiguration<{ }>("http://localhost:2746", { })
export const server2 = new ServerConfiguration<{ }>("https://localhost:2746", { })
export const servers = [server1, server2];

View file

@ -1,28 +0,0 @@
{
"compilerOptions": {
"strict": true,
/* Basic Options */
"target": "es5",
"moduleResolution": "node",
"declaration": true,
/* Additional Checks */
"noUnusedLocals": false, /* Report errors on unused locals. */ // TODO: reenable (unused imports!)
"noUnusedParameters": false, /* Report errors on unused parameters. */ // TODO: set to true again
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
"removeComments": true,
"sourceMap": true,
"outDir": "./dist",
"noLib": false,
"lib": [ "es6", "dom" ],
},
"exclude": [
"dist",
"node_modules"
],
"filesGlob": [
"./**/*.ts",
]
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,37 +0,0 @@
/**
* Returns if a specific http code is in a given code range
* where the code range is defined as a combination of digits
* and "X" (the letter X) with a length of 3
*
* @param codeRange string with length 3 consisting of digits and "X" (the letter X)
* @param code the http status code to be checked against the code range
*/
export function isCodeInRange(codeRange: string, code: number): boolean {
// This is how the default value is encoded in OAG
if (codeRange === "0") {
return true;
}
if (codeRange == code.toString()) {
return true;
} else {
const codeString = code.toString();
if (codeString.length != codeRange.length) {
return false;
}
for (let i = 0; i < codeString.length; i++) {
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
return false;
}
}
return true;
}
}
/**
* Returns if it can consume form
*
* @param consumes array
*/
export function canConsumeForm(contentTypes: string[]): boolean {
return contentTypes.indexOf('multipart/form-data') !== -1
}

View file

@ -1,94 +1,74 @@
import {
ConfigApi,
createApiRef,
DiscoveryApi, OAuthRequestApi,
DiscoveryApi, IdentityApi
} from '@backstage/core-plugin-api';
import {KubernetesApi } from "@backstage/plugin-kubernetes";
import {createConfiguration, ServerConfiguration, WorkflowServiceApi} from "./generated";
import {
IoArgoprojWorkflowV1alpha1WorkflowList,
} from "./generated/";
const API_VERSION = 'argoproj.io/v1alpha1'
const WORKFLOW_PLURAL = 'workflows'
const DEFAULT_WORKFLOW_PROXY = '/argo-workflows/api'
const API_LABEL_SELECTOR = 'listOptions.labelSelector'
const API_TIMEOUT = "listOptions.timeoutSeconds"
const K8s_API_TIMEOUT = "timeoutSeconds"
export const argoWorkflowsApiRef = createApiRef<ArgoWorkflowsApi>({
id: 'plugin.argoworkflows',
})
export interface ArgoWorkflowsApi {
discoveryApi: DiscoveryApi
kubernetesApi: KubernetesApi
getWorkflowsFromK8s(clusterName: string | undefined, namespace: string | undefined, labels: string | undefined): Promise<Workflow[]>
getWorkflows(name: string): Promise<Workflow[]>
getWorkflowsFromK8s(clusterName: string, namespace: string | undefined, labels: string | undefined): Promise<IoArgoprojWorkflowV1alpha1WorkflowList>
getWorkflows(clusterName: string | undefined, namespace: string | undefined, labels: string | undefined): Promise<IoArgoprojWorkflowV1alpha1WorkflowList>
getWorkflowsFromProxy(namespace: string, labels: string | undefined): Promise<IoArgoprojWorkflowV1alpha1WorkflowList>
}
type Metadata = {
annotations: Record<string, string>
labels: Record<string, string>
name: string
namespace: string
}
export type Workflow = {
metadata: Metadata
status?: WorkflowStatus
}
type WorkflowStatus = {
finishedAt: string
startedAt: string
phase: string
progress: string
}
type workflowResponse = {
items: Workflow[]
}
// type Metadata = {
// annotations: Record<string, string>
// labels: Record<string, string>
// name: string
// namespace: string
// }
//
// export type Workflow = {
// metadata: Metadata
// status?: WorkflowStatus
// }
//
// type WorkflowStatus = {
// finishedAt: string
// startedAt: string
// phase: string
// progress: string
// }
//
// type workflowResponse = {
// items: Workflow[]
// }
export class ArgoWorkflows implements ArgoWorkflowsApi {
discoveryApi: DiscoveryApi
kubernetesApi: KubernetesApi
configApi: ConfigApi
oauthRequestApi: OAuthRequestApi
identityApi: IdentityApi
constructor(discoveryApi: DiscoveryApi, kubernetesApi: KubernetesApi, configApi: ConfigApi, oauthRequestApi: OAuthRequestApi) {
constructor(discoveryApi: DiscoveryApi, kubernetesApi: KubernetesApi, configApi: ConfigApi, identityApi: IdentityApi) {
this.discoveryApi = discoveryApi
this.kubernetesApi = kubernetesApi
this.configApi = configApi
this.oauthRequestApi = oauthRequestApi
this.identityApi = identityApi
}
async workflowsApiSvc(): Promise<WorkflowServiceApi> {
const proxyUrl = await this.discoveryApi.getBaseUrl('proxy')
const svcConf = createConfiguration({
baseServer: new ServerConfiguration(proxyUrl, {})
})
return new WorkflowServiceApi(svcConf)
}
async getWorkflows(namespace: string | undefined, labels: string | undefined): Promise<Workflow[]> {
const svc = await this.workflowsApiSvc()
const ns = namespace !== undefined ? namespace : 'default'
const ops = {
namespace: ns,
listOptionsLabelSelector: labels,
listOptionsTimeoutSeconds: "30"
}
const resp = await svc.workflowServiceListWorkflows(
ops.namespace,
ops.listOptionsLabelSelector,
undefined,
undefined,
undefined,
undefined,
undefined,
ops.listOptionsTimeoutSeconds
)
}
async getWorkflowsFromK8s(clusterName: string | undefined, namespace: string | undefined, labels: string | undefined): Promise<Workflow[]> {
async getWorkflowsFromK8s(clusterName: string | undefined, namespace: string | undefined, labels: string | undefined): Promise<IoArgoprojWorkflowV1alpha1WorkflowList> {
const ns = namespace !== undefined ? namespace : 'default'
const path = `/apis/${API_VERSION}/namespaces/${ns}/${WORKFLOW_PLURAL}`
const query = new URLSearchParams()
const query = new URLSearchParams({
[K8s_API_TIMEOUT]: "30"
})
if (labels) {
query.set('labelSelector', labels)
}
@ -102,9 +82,48 @@ export class ArgoWorkflows implements ArgoWorkflowsApi {
return Promise.reject(`failed to fetch resources: ${resp.status}, ${resp.statusText}, ${await resp.json()}`)
}
// need validation
const workflows = JSON.parse(await resp.text()) as workflowResponse
return JSON.parse(await resp.text()) as IoArgoprojWorkflowV1alpha1WorkflowList
}
return Promise.resolve(workflows.items);
getWorkflows(clusterName: string | undefined, namespace: string, labels: string | undefined): Promise<IoArgoprojWorkflowV1alpha1WorkflowList> {
if (clusterName) {
return this.getWorkflowsFromK8s(clusterName, namespace, labels)
}
return this.getWorkflowsFromProxy(namespace, labels);
}
async getWorkflowsFromProxy(namespace: string | undefined, labels: string | undefined): Promise<IoArgoprojWorkflowV1alpha1WorkflowList> {
const proxyUrl = await this.discoveryApi.getBaseUrl('proxy')
const ns = namespace !== undefined ? namespace : 'default'
const url = `${proxyUrl}/${DEFAULT_WORKFLOW_PROXY}/api/v1/workflows/${ns}`
const query = new URLSearchParams(
{[API_TIMEOUT]: "30"}
)
if (labels) {
query.set(API_LABEL_SELECTOR, labels)
}
const { token } = await this.identityApi.getCredentials()
const headers = new Headers(
{
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
}
)
const resp = await fetch(`${url}/${query.toString()}`, {
headers: headers
})
if (!resp.ok) {
return Promise.reject(`failed to fetch resources: ${resp.status}, ${resp.statusText}, ${await resp.json()}`)
}
// need validation
return Promise.resolve(JSON.parse(await resp.text()) as IoArgoprojWorkflowV1alpha1WorkflowList);
}

View file

@ -1,10 +1,11 @@
import {useApi} from "@backstage/core-plugin-api";
import {argoWorkflowsApiRef, Workflow} from "../../api/indext";
import {argoWorkflowsApiRef} from "../../api/indext";
import useAsync from "react-use/lib/useAsync";
import {Progress, Table, TableColumn} from '@backstage/core-components'
import React from "react";
import Alert from "@material-ui/lab/Alert";
import { useEntity } from '@backstage/plugin-catalog-react';
import {IoArgoprojWorkflowV1alpha1WorkflowList} from "../../api/generated";
type TableData = {
@ -47,17 +48,18 @@ export const WorkflowOverviewComponent = () => {
const k8sLabelSelector = entity.metadata.annotations?.['backstage.io/kubernetes-label-selector']
const {value, loading, error} = useAsync(
async (): Promise<Workflow[]> => {
async (): Promise<IoArgoprojWorkflowV1alpha1WorkflowList> => {
return await apiClient.getWorkflows(clusterName, ns, k8sLabelSelector)
}
)
if (loading) {
return <Progress />;
} else if (error) {
return <Alert severity="error">{error.message}</Alert>;
}
const data = value?.map( val => {
const data = value?.items.map( val => {
return {
name: val.metadata.name,
phase: val.status?.phase,

View file

@ -3,7 +3,7 @@ import {
createApiFactory,
createPlugin,
createRoutableExtension,
discoveryApiRef, oauthRequestApiRef
discoveryApiRef, identityApiRef
} from '@backstage/core-plugin-api';
import { rootRouteRef } from './routes';
@ -22,12 +22,12 @@ export const argoWorkflowsPlugin = createPlugin({
deps: {
discoveryApi: discoveryApiRef,
kubernetesApi: kubernetesApiRef,
oauthRequestApi: oauthRequestApiRef,
identityApi: identityApiRef,
configApi: configApiRef},
factory: ({
discoveryApi, kubernetesApi, configApi, oauthRequestApi,
discoveryApi, kubernetesApi, configApi, identityApi,
}) =>
new ArgoWorkflows(discoveryApi, kubernetesApi, configApi, oauthRequestApi)
new ArgoWorkflows(discoveryApi, kubernetesApi, configApi, identityApi)
})
]
});