/** * OriginStamp Client * * OpenAPI spec version: 3.0 * OriginStamp Documentation: https://doc.originstamp.org * Contact: mail@originstamp.com * Generated by: https://github.com/swagger-api/swagger-codegen.git */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http'; import { CustomHttpUrlEncodingCodec } from '../encoder'; import { Observable } from 'rxjs'; import { DefaultSchedulerResponse } from '../model/defaultSchedulerResponse'; import { SchedulerRequest } from '../model/schedulerRequest'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class SchedulerService { protected basePath = 'https://api.originstamp.com'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; this.basePath = basePath || configuration.basePath || this.basePath; } } /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise */ private canConsumeForm(consumes: string[]): boolean { const form = 'multipart/form-data'; for (let consume of consumes) { if (form === consume) { return true; } } return false; } /** * NextSchedule * Get the next scheduling time for hash submissions to the blockchain. * @param authorization A valid API key is essential for authorization to handle the request. * @param schedulerRequest Request DTO for next schedules. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public getNextSchedulingTime(authorization: string, schedulerRequest: SchedulerRequest, observe?: 'body', reportProgress?: boolean): Observable; public getNextSchedulingTime(authorization: string, schedulerRequest: SchedulerRequest, observe?: 'response', reportProgress?: boolean): Observable>; public getNextSchedulingTime(authorization: string, schedulerRequest: SchedulerRequest, observe?: 'events', reportProgress?: boolean): Observable>; public getNextSchedulingTime(authorization: string, schedulerRequest: SchedulerRequest, observe: any = 'body', reportProgress: boolean = false ): Observable { if (authorization === null || authorization === undefined) { throw new Error('Required parameter authorization was null or undefined when calling getNextSchedulingTime.'); } if (schedulerRequest === null || schedulerRequest === undefined) { throw new Error('Required parameter schedulerRequest was null or undefined when calling getNextSchedulingTime.'); } let headers = this.defaultHeaders; if (authorization !== undefined && authorization !== null) { headers = headers.set('Authorization', String(authorization)); } // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/json' ]; let httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set("Accept", httpHeaderAcceptSelected); } // to determine the Content-Type header let consumes: string[] = [ 'application/json' ]; let httpContentTypeSelected:string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set("Content-Type", httpContentTypeSelected); } return this.httpClient.post(`${this.basePath}/v3/submission/times`, schedulerRequest, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } }