/**
 * backend/api/experiment.proto
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: version not set
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */ import * as url from 'url' ; import * as portableFetch from 'portable-fetch' ; import { Configuration } from './configuration' ; const BASE_PATH = 'http://localhost' . replace ( /\/+$/ , '' ) ; export export const COLLECTION_FORMATS = { csv : ',' , ssv : ' ' , tsv : '\t' , pipes : '|' , } ; export interface export interface FetchAPI { ( url , init ? ) : Promise < Response > ; } export interface export interface FetchArgs { url : string ; options : any ; } export class export class BaseAPI { protected configuration : Configuration ; constructor ( configuration ? , protected basePath = BASE_PATH , protected fetch = portableFetch ) { if ( configuration ) { this . configuration = configuration ; this . basePath = configuration . basePath || this . basePath ; } } } export class extends Error export class RequiredError extends Error { name : 'RequiredError' ; constructor ( public field , msg ? ) { super ( msg ) ; } } export interface export interface ApiExperiment { type { string } memberof id ? : string ; type { string } memberof name ? : string ; type { string } memberof description ? : string ; type { Date } memberof created_at ? : Date ; type { Array < ApiResourceReference > } memberof resource_references ? : Array < ApiResourceReference > ; type { ApiExperimentStorageState } memberof storage_state ? : ApiExperimentStorageState ; } export enum { string } export enum ApiExperimentStorageState { UNSPECIFIED = < any > 'STORAGESTATE_UNSPECIFIED' , AVAILABLE = < any > 'STORAGESTATE_AVAILABLE' , ARCHIVED = < any > 'STORAGESTATE_ARCHIVED' } export interface export interface ApiListExperimentsResponse { type { Array < ApiExperiment > } memberof experiments ? : Array < ApiExperiment > ; type { number } memberof total_size ? : number ; type { string } memberof next_page_token ? : string ; } export enum { string } export enum ApiRelationship { UNKNOWNRELATIONSHIP = < any > 'UNKNOWN_RELATIONSHIP' , OWNER = < any > 'OWNER' , CREATOR = < any > 'CREATOR' } export interface export interface ApiResourceKey { type { ApiResourceType } memberof type ? : ApiResourceType ; type { string } memberof id ? : string ; } export interface export interface ApiResourceReference { type { ApiResourceKey } memberof key ? : ApiResourceKey ; type { string } memberof name ? : string ; type { ApiRelationship } memberof relationship ? : ApiRelationship ; } export enum { string } export enum ApiResourceType { UNKNOWNRESOURCETYPE = < any > 'UNKNOWN_RESOURCE_TYPE' , EXPERIMENT = < any > 'EXPERIMENT' , JOB = < any > 'JOB' , PIPELINE = < any > 'PIPELINE' , PIPELINEVERSION = < any > 'PIPELINE_VERSION' , NAMESPACE = < any > 'NAMESPACE' } export interface export interface ApiStatus { type { string } memberof error ? : string ; type { number } memberof code ? : number ; type { Array < ProtobufAny > } memberof details ? : Array < ProtobufAny > ; } export interface export interface ProtobufAny { type { string } memberof type_url ? : string ; type { string } memberof value ? : string ; } export export const ExperimentServiceApiFetchParamCreator = function ( configuration ? ) { return { summary param { string } id param { * } options throws archiveExperiment ( id , options = { } ) { if ( id === null || id === undefined ) { throw new RequiredError ( 'id' , 'Required parameter id was null or undefined when calling archiveExperiment.' ) ; } const localVarPath = `/apis/v1beta1/experiments/{id}:archive` . replace ( `{${ 'id' }}` , encodeURIComponent ( String ( id ) ) ) ; const localVarUrlObj = url . parse ( localVarPath , true ) ; const localVarRequestOptions = Object . assign ( { method : 'POST' } , options ) ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( configuration && configuration . apiKey ) { const localVarApiKeyValue = typeof configuration . apiKey === 'function' ? configuration . apiKey ( 'authorization' ) : configuration . apiKey ; localVarHeaderParameter [ 'authorization' ] = localVarApiKeyValue ; } localVarUrlObj . query = Object . assign ( { } , localVarUrlObj . query , localVarQueryParameter , options . query ) ; delete localVarUrlObj . search ; localVarRequestOptions . headers = Object . assign ( { } , localVarHeaderParameter , options . headers ) ; return { url : url . format ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , summary param { ApiExperiment } body param { * } options throws createExperiment ( body , options = { } ) { if ( body === null || body === undefined ) { throw new RequiredError ( 'body' , 'Required parameter body was null or undefined when calling createExperiment.' ) ; } const localVarPath = `/apis/v1beta1/experiments` ; const localVarUrlObj = url . parse ( localVarPath , true ) ; const localVarRequestOptions = Object . assign ( { method : 'POST' } , options ) ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( configuration && configuration . apiKey ) { const localVarApiKeyValue = typeof configuration . apiKey === 'function' ? configuration . apiKey ( 'authorization' ) : configuration . apiKey ; localVarHeaderParameter [ 'authorization' ] = localVarApiKeyValue ; } localVarHeaderParameter [ 'Content-Type' ] = 'application/json' ; localVarUrlObj . query = Object . assign ( { } , localVarUrlObj . query , localVarQueryParameter , options . query ) ; delete localVarUrlObj . search ; localVarRequestOptions . headers = Object . assign ( { } , localVarHeaderParameter , options . headers ) ; const needsSerialization = < any > 'ApiExperiment' !== 'string' || localVarRequestOptions . headers [ 'Content-Type' ] === 'application/json' ; localVarRequestOptions . body = needsSerialization ? JSON . stringify ( body || { } ) : body || '' ; return { url : url . format ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , summary param { string } id param { * } options throws deleteExperiment ( id , options = { } ) { if ( id === null || id === undefined ) { throw new RequiredError ( 'id' , 'Required parameter id was null or undefined when calling deleteExperiment.' ) ; } const localVarPath = `/apis/v1beta1/experiments/{id}` . replace ( `{${ 'id' }}` , encodeURIComponent ( String ( id ) ) ) ; const localVarUrlObj = url . parse ( localVarPath , true ) ; const localVarRequestOptions = Object . assign ( { method : 'DELETE' } , options ) ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( configuration && configuration . apiKey ) { const localVarApiKeyValue = typeof configuration . apiKey === 'function' ? configuration . apiKey ( 'authorization' ) : configuration . apiKey ; localVarHeaderParameter [ 'authorization' ] = localVarApiKeyValue ; } localVarUrlObj . query = Object . assign ( { } , localVarUrlObj . query , localVarQueryParameter , options . query ) ; delete localVarUrlObj . search ; localVarRequestOptions . headers = Object . assign ( { } , localVarHeaderParameter , options . headers ) ; return { url : url . format ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , summary param { string } id param { * } options throws getExperiment ( id , options = { } ) { if ( id === null || id === undefined ) { throw new RequiredError ( 'id' , 'Required parameter id was null or undefined when calling getExperiment.' ) ; } const localVarPath = `/apis/v1beta1/experiments/{id}` . replace ( `{${ 'id' }}` , encodeURIComponent ( String ( id ) ) ) ; const localVarUrlObj = url . parse ( localVarPath , true ) ; const localVarRequestOptions = Object . assign ( { method : 'GET' } , options ) ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( configuration && configuration . apiKey ) { const localVarApiKeyValue = typeof configuration . apiKey === 'function' ? configuration . apiKey ( 'authorization' ) : configuration . apiKey ; localVarHeaderParameter [ 'authorization' ] = localVarApiKeyValue ; } localVarUrlObj . query = Object . assign ( { } , localVarUrlObj . query , localVarQueryParameter , options . query ) ; delete localVarUrlObj . search ; localVarRequestOptions . headers = Object . assign ( { } , localVarHeaderParameter , options . headers ) ; return { url : url . format ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , summary param { string } page_token param { number } page_size param { string } sort_by param { string } filter param { 'UNKNOWN_RESOURCE_TYPE' | 'EXPERIMENT' | 'JOB' | 'PIPELINE' | 'PIPELINE_VERSION' | 'NAMESPACE' } resource_reference_key_type param { string } resource_reference_key_id param { * } options throws listExperiment ( page_token ? , page_size ? , sort_by ? , filter ? , resource_reference_key_type ? , resource_reference_key_id ? , options = { } ) { const localVarPath = `/apis/v1beta1/experiments` ; const localVarUrlObj = url . parse ( localVarPath , true ) ; const localVarRequestOptions = Object . assign ( { method : 'GET' } , options ) ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( configuration && configuration . apiKey ) { const localVarApiKeyValue = typeof configuration . apiKey === 'function' ? configuration . apiKey ( 'authorization' ) : configuration . apiKey ; localVarHeaderParameter [ 'authorization' ] = localVarApiKeyValue ; } if ( page_token !== undefined ) { localVarQueryParameter [ 'page_token' ] = page_token ; } if ( page_size !== undefined ) { localVarQueryParameter [ 'page_size' ] = page_size ; } if ( sort_by !== undefined ) { localVarQueryParameter [ 'sort_by' ] = sort_by ; } if ( filter !== undefined ) { localVarQueryParameter [ 'filter' ] = filter ; } if ( resource_reference_key_type !== undefined ) { localVarQueryParameter [ 'resource_reference_key.type' ] = resource_reference_key_type ; } if ( resource_reference_key_id !== undefined ) { localVarQueryParameter [ 'resource_reference_key.id' ] = resource_reference_key_id ; } localVarUrlObj . query = Object . assign ( { } , localVarUrlObj . query , localVarQueryParameter , options . query ) ; delete localVarUrlObj . search ; localVarRequestOptions . headers = Object . assign ( { } , localVarHeaderParameter , options . headers ) ; return { url : url . format ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , summary param { string } id param { * } options throws unarchiveExperiment ( id , options = { } ) { if ( id === null || id === undefined ) { throw new RequiredError ( 'id' , 'Required parameter id was null or undefined when calling unarchiveExperiment.' ) ; } const localVarPath = `/apis/v1beta1/experiments/{id}:unarchive` . replace ( `{${ 'id' }}` , encodeURIComponent ( String ( id ) ) ) ; const localVarUrlObj = url . parse ( localVarPath , true ) ; const localVarRequestOptions = Object . assign ( { method : 'POST' } , options ) ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( configuration && configuration . apiKey ) { const localVarApiKeyValue = typeof configuration . apiKey === 'function' ? configuration . apiKey ( 'authorization' ) : configuration . apiKey ; localVarHeaderParameter [ 'authorization' ] = localVarApiKeyValue ; } localVarUrlObj . query = Object . assign ( { } , localVarUrlObj . query , localVarQueryParameter , options . query ) ; delete localVarUrlObj . search ; localVarRequestOptions . headers = Object . assign ( { } , localVarHeaderParameter , options . headers ) ; return { url : url . format ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , } ; } ; export export const ExperimentServiceApiFp = function ( configuration ? ) { return { summary param { string } id param { * } options throws archiveExperiment ( id , options ? ) { const localVarFetchArgs = ExperimentServiceApiFetchParamCreator ( configuration ) . archiveExperiment ( id , options ) ; return ( fetch = portableFetch , basePath = BASE_PATH ) => { return fetch ( basePath + localVarFetchArgs . url , localVarFetchArgs . options ) . then ( response => { if ( response . status >= 200 && response . status < 300 ) { return response . json ( ) ; } else { throw response ; } } ) ; } ; } , summary param { ApiExperiment } body param { * } options throws createExperiment ( body , options ? ) { const localVarFetchArgs = ExperimentServiceApiFetchParamCreator ( configuration ) . createExperiment ( body , options ) ; return ( fetch = portableFetch , basePath = BASE_PATH ) => { return fetch ( basePath + localVarFetchArgs . url , localVarFetchArgs . options ) . then ( response => { if ( response . status >= 200 && response . status < 300 ) { return response . json ( ) ; } else { throw response ; } } ) ; } ; } , summary param { string } id param { * } options throws deleteExperiment ( id , options ? ) { const localVarFetchArgs = ExperimentServiceApiFetchParamCreator ( configuration ) . deleteExperiment ( id , options ) ; return ( fetch = portableFetch , basePath = BASE_PATH ) => { return fetch ( basePath + localVarFetchArgs . url , localVarFetchArgs . options ) . then ( response => { if ( response . status >= 200 && response . status < 300 ) { return response . json ( ) ; } else { throw response ; } } ) ; } ; } , summary param { string } id param { * } options throws getExperiment ( id , options ? ) { const localVarFetchArgs = ExperimentServiceApiFetchParamCreator ( configuration ) . getExperiment ( id , options ) ; return ( fetch = portableFetch , basePath = BASE_PATH ) => { return fetch ( basePath + localVarFetchArgs . url , localVarFetchArgs . options ) . then ( response => { if ( response . status >= 200 && response . status < 300 ) { return response . json ( ) ; } else { throw response ; } } ) ; } ; } , summary param { string } page_token param { number } page_size param { string } sort_by param { string } filter param { 'UNKNOWN_RESOURCE_TYPE' | 'EXPERIMENT' | 'JOB' | 'PIPELINE' | 'PIPELINE_VERSION' | 'NAMESPACE' } resource_reference_key_type param { string } resource_reference_key_id param { * } options throws listExperiment ( page_token ? , page_size ? , sort_by ? , filter ? , resource_reference_key_type ? , resource_reference_key_id ? , options ? ) { const localVarFetchArgs = ExperimentServiceApiFetchParamCreator ( configuration ) . listExperiment ( page_token , page_size , sort_by , filter , resource_reference_key_type , resource_reference_key_id , options ) ; return ( fetch = portableFetch , basePath = BASE_PATH ) => { return fetch ( basePath + localVarFetchArgs . url , localVarFetchArgs . options ) . then ( response => { if ( response . status >= 200 && response . status < 300 ) { return response . json ( ) ; } else { throw response ; } } ) ; } ; } , summary param { string } id param { * } options throws unarchiveExperiment ( id , options ? ) { const localVarFetchArgs = ExperimentServiceApiFetchParamCreator ( configuration ) . unarchiveExperiment ( id , options ) ; return ( fetch = portableFetch , basePath = BASE_PATH ) => { return fetch ( basePath + localVarFetchArgs . url , localVarFetchArgs . options ) . then ( response => { if ( response . status >= 200 && response . status < 300 ) { return response . json ( ) ; } else { throw response ; } } ) ; } ; } , } ; } ; export export const ExperimentServiceApiFactory = function ( configuration ? , fetch ? , basePath ? ) { return { summary param { string } id param { * } options throws archiveExperiment ( id , options ? ) { return ExperimentServiceApiFp ( configuration ) . archiveExperiment ( id , options ) ( fetch , basePath ) ; } , summary param { ApiExperiment } body param { * } options throws createExperiment ( body , options ? ) { return ExperimentServiceApiFp ( configuration ) . createExperiment ( body , options ) ( fetch , basePath ) ; } , summary param { string } id param { * } options throws deleteExperiment ( id , options ? ) { return ExperimentServiceApiFp ( configuration ) . deleteExperiment ( id , options ) ( fetch , basePath ) ; } , summary param { string } id param { * } options throws getExperiment ( id , options ? ) { return ExperimentServiceApiFp ( configuration ) . getExperiment ( id , options ) ( fetch , basePath ) ; } , summary param { string } page_token param { number } page_size param { string } sort_by param { string } filter param { 'UNKNOWN_RESOURCE_TYPE' | 'EXPERIMENT' | 'JOB' | 'PIPELINE' | 'PIPELINE_VERSION' | 'NAMESPACE' } resource_reference_key_type param { string } resource_reference_key_id param { * } options throws listExperiment ( page_token ? , page_size ? , sort_by ? , filter ? , resource_reference_key_type ? , resource_reference_key_id ? , options ? ) { return ExperimentServiceApiFp ( configuration ) . listExperiment ( page_token , page_size , sort_by , filter , resource_reference_key_type , resource_reference_key_id , options ) ( fetch , basePath ) ; } , summary param { string } id param { * } options throws unarchiveExperiment ( id , options ? ) { return ExperimentServiceApiFp ( configuration ) . unarchiveExperiment ( id , options ) ( fetch , basePath ) ; } , } ; } ; export class extends BaseAPI export class ExperimentServiceApi extends BaseAPI { summary param { string } id param { * } options throws memberof public archiveExperiment ( id , options ? ) { return ExperimentServiceApiFp ( this . configuration ) . archiveExperiment ( id , options ) ( this . fetch , this . basePath ) ; } summary param { ApiExperiment } body param { * } options throws memberof public createExperiment ( body , options ? ) { return ExperimentServiceApiFp ( this . configuration ) . createExperiment ( body , options ) ( this . fetch , this . basePath ) ; } summary param { string } id param { * } options throws memberof public deleteExperiment ( id , options ? ) { return ExperimentServiceApiFp ( this . configuration ) . deleteExperiment ( id , options ) ( this . fetch , this . basePath ) ; } summary param { string } id param { * } options throws memberof public getExperiment ( id , options ? ) { return ExperimentServiceApiFp ( this . configuration ) . getExperiment ( id , options ) ( this . fetch , this . basePath ) ; } summary param { string } page_token param { number } page_size param { string } sort_by param { string } filter param { 'UNKNOWN_RESOURCE_TYPE' | 'EXPERIMENT' | 'JOB' | 'PIPELINE' | 'PIPELINE_VERSION' | 'NAMESPACE' } resource_reference_key_type param { string } resource_reference_key_id param { * } options throws memberof public listExperiment ( page_token ? , page_size ? , sort_by ? , filter ? , resource_reference_key_type ? , resource_reference_key_id ? , options ? ) { return ExperimentServiceApiFp ( this . configuration ) . listExperiment ( page_token , page_size , sort_by , filter , resource_reference_key_type , resource_reference_key_id , options ) ( this . fetch , this . basePath ) ; } summary param { string } id param { * } options throws memberof public unarchiveExperiment ( id , options ? ) { return ExperimentServiceApiFp ( this . configuration ) . unarchiveExperiment ( id , options ) ( this . fetch , this . basePath ) ; } }