Skip to content

Commit

Permalink
Adds support for adding a meeting method filter to a location resource
Browse files Browse the repository at this point in the history
  • Loading branch information
craigpaul committed May 19, 2020
1 parent 055aec3 commit 4fd7dc9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/resources/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface LocationFilter {
assigned?: boolean;
invitable?: number;
preferred?: number;
method?: number;
services?: number | number[] | string | string[];
user?: number | string;
virtual?: number;
Expand All @@ -27,6 +28,7 @@ export interface LocationFilter {
export interface LocationParameters {
assignments?: number;
city?: string;
client_view_meeting_method?: number;
country?: string;
invite_only?: number;
preferred?: number;
Expand Down Expand Up @@ -55,6 +57,8 @@ export interface LocationResource extends Pageable, ConditionalResource {

suggest(query: string): Promise<any>;

supporting(method: number): this;

virtual(): this;
}

Expand Down Expand Up @@ -176,6 +180,12 @@ export default class Location extends Conditional implements LocationResource {
return await this.client.get('location-suggestions', { headers, params });
}

public supporting(method: number): this {
this.filters.method = method;

return this;
}

public take(limit: number): this {
this.limit = limit;

Expand Down Expand Up @@ -207,6 +217,10 @@ export default class Location extends Conditional implements LocationResource {
params.invite_only = this.filters.invitable;
}

if (typeof this.filters.method !== 'undefined') {
params.client_view_meeting_method = this.filters.method;
}

if (typeof this.filters.preferred !== 'undefined') {
params.preferred = this.filters.preferred;
}
Expand Down

0 comments on commit 4fd7dc9

Please sign in to comment.