@vectorize-io/vectorize-client
Version:
Client for the Vectorize API
158 lines (143 loc) • 4.96 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Vectorize API
* API for Vectorize services (Beta)
*
* The version of the OpenAPI document: 0.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
* Configuration for GitHub connector
* @export
* @interface GITHUBConfig
*/
export interface GITHUBConfig {
/**
* Repositories. Example: Example: owner1/repo1
* @type {Array<string>}
* @memberof GITHUBConfig
*/
repositories: Array<string>;
/**
* Include Pull Requests
* @type {boolean}
* @memberof GITHUBConfig
*/
includePullRequests: boolean;
/**
* Pull Request Status
* @type {string}
* @memberof GITHUBConfig
*/
pullRequestStatus: GITHUBConfigPullRequestStatusEnum;
/**
* Pull Request Labels. Example: Optionally filter by label. E.g. fix
* @type {Array<string>}
* @memberof GITHUBConfig
*/
pullRequestLabels?: Array<string>;
/**
* Include Issues
* @type {boolean}
* @memberof GITHUBConfig
*/
includeIssues: boolean;
/**
* Issue Status
* @type {string}
* @memberof GITHUBConfig
*/
issueStatus: GITHUBConfigIssueStatusEnum;
/**
* Issue Labels. Example: Optionally filter by label. E.g. bug
* @type {Array<string>}
* @memberof GITHUBConfig
*/
issueLabels?: Array<string>;
/**
* Max Items. Leave blank for no limit, or specify a maximum number. Example: Enter maximum number of items to fetch (leave blank for no limit)
* @type {number}
* @memberof GITHUBConfig
*/
maxItems?: number;
/**
* Created After. Filter for items created after this date. Example: Enter a date: Example 2012-12-31
* @type {Date}
* @memberof GITHUBConfig
*/
createdAfter?: Date;
}
/**
* @export
*/
export const GITHUBConfigPullRequestStatusEnum = {
All: 'all',
Open: 'open',
Closed: 'closed',
Merged: 'merged'
} as const;
export type GITHUBConfigPullRequestStatusEnum = typeof GITHUBConfigPullRequestStatusEnum[keyof typeof GITHUBConfigPullRequestStatusEnum];
/**
* @export
*/
export const GITHUBConfigIssueStatusEnum = {
All: 'all',
Open: 'open',
Closed: 'closed'
} as const;
export type GITHUBConfigIssueStatusEnum = typeof GITHUBConfigIssueStatusEnum[keyof typeof GITHUBConfigIssueStatusEnum];
/**
* Check if a given object implements the GITHUBConfig interface.
*/
export function instanceOfGITHUBConfig(value: object): value is GITHUBConfig {
if (!('repositories' in value) || value['repositories'] === undefined) return false;
if (!('includePullRequests' in value) || value['includePullRequests'] === undefined) return false;
if (!('pullRequestStatus' in value) || value['pullRequestStatus'] === undefined) return false;
if (!('includeIssues' in value) || value['includeIssues'] === undefined) return false;
if (!('issueStatus' in value) || value['issueStatus'] === undefined) return false;
return true;
}
export function GITHUBConfigFromJSON(json: any): GITHUBConfig {
return GITHUBConfigFromJSONTyped(json, false);
}
export function GITHUBConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): GITHUBConfig {
if (json == null) {
return json;
}
return {
'repositories': json['repositories'],
'includePullRequests': json['include-pull-requests'],
'pullRequestStatus': json['pull-request-status'],
'pullRequestLabels': json['pull-request-labels'] == null ? undefined : json['pull-request-labels'],
'includeIssues': json['include-issues'],
'issueStatus': json['issue-status'],
'issueLabels': json['issue-labels'] == null ? undefined : json['issue-labels'],
'maxItems': json['max-items'] == null ? undefined : json['max-items'],
'createdAfter': json['created-after'] == null ? undefined : (new Date(json['created-after'])),
};
}
export function GITHUBConfigToJSON(json: any): GITHUBConfig {
return GITHUBConfigToJSONTyped(json, false);
}
export function GITHUBConfigToJSONTyped(value?: GITHUBConfig | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'repositories': value['repositories'],
'include-pull-requests': value['includePullRequests'],
'pull-request-status': value['pullRequestStatus'],
'pull-request-labels': value['pullRequestLabels'],
'include-issues': value['includeIssues'],
'issue-status': value['issueStatus'],
'issue-labels': value['issueLabels'],
'max-items': value['maxItems'],
'created-after': value['createdAfter'] == null ? undefined : ((value['createdAfter']).toISOString().substring(0,10)),
};
}