/** * NymOS API 1.9.21 * * The contents of this file are subject to the NymOS License, version 1.0. * It is forbidden the use of the codes included on this file, even partially, * for third parties, such as its copy, without express authorization of the * intelectual property and commercial rights owners. A copy of the license * may be obtained at http://nymos.io/source-license. The intelectual * property and comercial rights of this file and codes belong to NymOS S.A. * * Copyright (c) 2017. All rights reserved. * */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; import { CustomHttpUrlEncodingCodec } from '../internal/encoder'; import { Problem } from '../models/problem.model'; import { SupportTicket } from '../models/support-ticket.model'; @Injectable() export class SupportService { constructor(protected httpClient: HttpClient) { } /** * Create a new ticket. * This `endpoint` can be used to create a new support ticket. For *authenticated* users, `full_name`, `email` and `mobile` are optional. For *anonymous* users, `full_name`, (`email` or `mobile`) are also required although this `endpoint` flags them as optional. * @param content * @param subject * @param fullName * @param mobile * @param email * @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 createTicket(content: string, subject?: string, fullName?: string, mobile?: string, email?: string): Observable { if (content === null || content === undefined) { throw new Error('Required parameter content was null or undefined when calling createTicket.'); } let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (subject !== undefined) { queryParameters = queryParameters.set('subject', subject); } if (content !== undefined) { queryParameters = queryParameters.set('content', content); } if (fullName !== undefined) { queryParameters = queryParameters.set('full_name', fullName); } if (mobile !== undefined) { queryParameters = queryParameters.set('mobile', mobile); } if (email !== undefined) { queryParameters = queryParameters.set('email', email); } let headers = new HttpHeaders(); return this.httpClient.post(`https://support-dot-nymos-dev.appspot.com/v1/support/tickets`, { params: queryParameters, headers: headers, } ); } }