/** * This file is auto-generated by the API client generator. * https://github.com/flowup/api-client-generator * * Avoid editing this file manually unless necessary. * Please report any bugs so they can be addressed in future versions. */ /* tslint:disable */ /* eslint-disable */ import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http'; import { Inject, Injectable, InjectionToken, Optional } from '@angular/core'; import { UsersAPIClientInterface } from './users-api-client.interface'; import { Observable } from 'rxjs';import { DefaultHttpOptions, HttpOptions } from '../../types'; import * as models from '../../models'; export const USE_DOMAIN = new InjectionToken('UsersAPIClient_USE_DOMAIN'); export const USE_HTTP_OPTIONS = new InjectionToken('UsersAPIClient_USE_HTTP_OPTIONS'); type APIHttpOptions = HttpOptions & { headers: HttpHeaders; params: HttpParams; }; @Injectable() export class UsersAPIClient implements UsersAPIClientInterface { readonly options: APIHttpOptions; readonly domain: string = `https://api.github.com`; constructor( private readonly http: HttpClient, @Optional() @Inject(USE_DOMAIN) domain?: string, @Optional() @Inject(USE_HTTP_OPTIONS) options?: DefaultHttpOptions, ) { if (domain != null) { this.domain = domain; } this.options = { headers: new HttpHeaders(options && options.headers ? options.headers : {}), params: new HttpParams(options && options.params ? options.params : {}), ...(options && options.reportProgress ? { reportProgress: options.reportProgress } : {}), ...(options && options.withCredentials ? { withCredentials: options.withCredentials } : {}) }; } /** * Get all users. * This provides a dump of every user, in the order that they signed up for GitHub. * Note: Pagination is powered exclusively by the since parameter. Use the Link * header to get the URL for the next page of users. * * Response generated for [ 200 ] HTTP response code. */ getUsers( args?: UsersAPIClientInterface['getUsersParams'], requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsers( args?: UsersAPIClientInterface['getUsersParams'], requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsers( args?: UsersAPIClientInterface['getUsersParams'], requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsers( args: UsersAPIClientInterface['getUsersParams'] = {}, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('since' in args) { options.params = options.params.set('since', String(args.since)); } if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * Get a single user. * Response generated for [ 200 ] HTTP response code. */ getUsersUsername( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsername( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsername( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsername( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. * Response generated for [ default ] HTTP response code. */ getUsersUsernameEvents( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameEvents( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameEvents( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameEvents( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/events`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * This is the user's organization dashboard. You must be authenticated as the user to view this. * Response generated for [ default ] HTTP response code. */ getUsersUsernameEventsOrg( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameEventsOrg( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameEventsOrg( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameEventsOrg( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/events/orgs/${args.org}`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * List a user's followers * Response generated for [ 200 ] HTTP response code. */ getUsersUsernameFollowers( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameFollowers( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameFollowers( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameFollowers( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/followers`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * Check if one user follows another. * Response generated for [ 204 ] HTTP response code. */ getUsersUsernameFollowingTargetUser( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameFollowingTargetUser( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameFollowingTargetUser( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameFollowingTargetUser( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/following/${args.targetUser}`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * List a users gists. * Response generated for [ 200 ] HTTP response code. */ getUsersUsernameGists( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameGists( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameGists( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameGists( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/gists`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('since' in args) { options.params = options.params.set('since', String(args.since)); } if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * List public keys for a user. * Lists the verified public keys for a user. This is accessible by anyone. * * Response generated for [ 200 ] HTTP response code. */ getUsersUsernameKeys( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameKeys( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameKeys( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameKeys( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/keys`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * List all public organizations for a user. * Response generated for [ 200 ] HTTP response code. */ getUsersUsernameOrgs( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameOrgs( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameOrgs( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameOrgs( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/orgs`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * These are events that you'll only see public events. * Response generated for [ default ] HTTP response code. */ getUsersUsernameReceivedEvents( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameReceivedEvents( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameReceivedEvents( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameReceivedEvents( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/received_events`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * List public events that a user has received * Response generated for [ default ] HTTP response code. */ getUsersUsernameReceivedEventsPublic( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameReceivedEventsPublic( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameReceivedEventsPublic( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameReceivedEventsPublic( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/received_events/public`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * List public repositories for the specified user. * Response generated for [ 200 ] HTTP response code. */ getUsersUsernameRepos( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameRepos( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameRepos( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameRepos( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/repos`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('type' in args) { options.params = options.params.set('type', String(args.type)); } if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * List repositories being starred by a user. * Response generated for [ default ] HTTP response code. */ getUsersUsernameStarred( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameStarred( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameStarred( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameStarred( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/starred`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } /** * List repositories being watched by a user. * Response generated for [ default ] HTTP response code. */ getUsersUsernameSubscriptions( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'body', ): Observable; getUsersUsernameSubscriptions( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'response', ): Observable>; getUsersUsernameSubscriptions( args: Exclude, requestHttpOptions?: HttpOptions, observe?: 'events', ): Observable>; getUsersUsernameSubscriptions( args: Exclude, requestHttpOptions?: HttpOptions, observe: any = 'body', ): Observable | HttpEvent> { const path = `/users/${args.username}/subscriptions`; const options = { ...this.options, ...requestHttpOptions, observe, }; if ('xGitHubMediaType' in args) { options.headers = options.headers.set('X-GitHub-Media-Type', String(args.xGitHubMediaType)); } if ('accept' in args) { options.headers = options.headers.set('Accept', String(args.accept)); } if ('xRateLimit' in args) { options.headers = options.headers.set('X-RateLimit-Limit', String(args.xRateLimit)); } if ('xRateLimitRemaining' in args) { options.headers = options.headers.set('X-RateLimit-Remaining', String(args.xRateLimitRemaining)); } if ('xRateLimitReset' in args) { options.headers = options.headers.set('X-RateLimit-Reset', String(args.xRateLimitReset)); } if ('xGitHubRequestId' in args) { options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId)); } return this.http.get(`${this.domain}${path}`, options); } }