export interface Activity { action ? : string ; format created_at ? : string ; data ? : object ; id ? : number ; model ? : string ; format updated_at ? : string ; user_id ? : number ; } export interface Block { block_feeds ? : BlockFeed [ ] ; column ? : number ; description ? : string ; key ? : string ; name ? : string ; row ? : number ; size_x ? : number ; size_y ? : number ; visual_type ? : string ; } export interface BlockFeed { feed ? : Feed ; group ? : Group ; id ? : string ; } export interface Dashboard { blocks ? : Block [ ] ; description ? : string ; key ? : string ; name ? : string ; } export interface Data { completed_at ? : string ; created_at ? : string ; created_epoch ? : number ; ele ? : number ; expiration ? : string ; feed_id ? : number ; group_id ? : number ; id ? : string ; lat ? : number ; lon ? : number ; updated_at ? : string ; value ? : string ; } export interface DataResponse { completed_at ? : string ; created_at ? : string ; created_epoch ? : number ; ele ? : number ; expiration ? : string ; feed_id ? : number ; group_id ? : number ; id ? : string ; lat ? : number ; lon ? : number ; updated_at ? : string ; value ? : string ; } export interface Error { code ? : string ; message ? : string ; } export interface Feed { created_at ? : string ; description ? : string ; /** Additional details about this feed. */ details ? : { data ? : { count ? : number ; first ? : Record < string , Data > ; last ? : Record < string , Data > ; } ; shared_with ? : object [ ] ; } ; enabled ? : boolean ; group ? : Record < string , ShallowGroup > ; groups ? : ShallowGroup [ ] ; history ? : boolean ; id ? : number ; key ? : string ; last_value ? : string ; license ? : string ; name ? : string ; status ? : string ; /** Is status notification active? */ status_notify ? : boolean ; /** Status notification timeout in minutes. */ status_timeout ? : number ; unit_symbol ? : string ; unit_type ? : string ; updated_at ? : string ; visibility ? : "private" | "public" | "in progress" | "out of access" ; } export interface Group { created_at ? : string ; description ? : string ; feeds ? : Feed [ ] ; id ? : number ; name ? : string ; updated_at ? : string ; } export interface Permission { created_at ? : string ; id ? : number ; model ? : "feed" | "group" | "dashboard" ; object_id ? : number ; scope ? : "secret" | "public" | "user" | "organization" ; scope_value ? : string ; updated_at ? : string ; user_id ? : number ; } export interface ShallowGroup { created_at ? : string ; description ? : string ; id ? : number ; name ? : string ; updated_at ? : string ; } export interface Token { token ? : string ; } export interface Trigger { name ? : string ; } export interface User { color ? : string ; format created_at ? : string ; id ? : number ; name ? : string ; time_zone ? : string ; format updated_at ? : string ; username ? : string ; } export type QueryParamsType = Record < string | number , any > ; export type ResponseFormat = keyof Omit < Body , "body" | "bodyUsed" > ; export interface FullRequestParams extends Omit < RequestInit , "body" > { /** set parameter to `true` for call `securityWorker` for this request */ secure ? : boolean ; /** request path */ path : string ; /** content type of request body */ type ? : ContentType ; /** query params */ query ? : QueryParamsType ; /** format of response (i.e. response.json() -> format: "json") */ format ? : ResponseFormat ; /** request body */ body ? : unknown ; /** base url */ baseUrl ? : string ; /** request cancellation token */ cancelToken ? : CancelToken ; } export type RequestParams = Omit < FullRequestParams , "body" | "method" | "query" | "path" > ; export interface ApiConfig < SecurityDataType = unknown > { baseUrl ? : string ; baseApiParams ? : Omit < RequestParams , "baseUrl" | "cancelToken" | "signal" > ; securityWorker ? : ( securityData : SecurityDataType | null ) => Promise < RequestParams | void > | RequestParams | void ; customFetch ? : typeof fetch ; } export interface HttpResponse < D extends unknown , E extends unknown = unknown > extends Response { data : D ; error : E ; } type CancelToken = Symbol | string | number ; export enum ContentType { Json = "application/json" , FormData = "multipart/form-data" , UrlEncoded = "application/x-www-form-urlencoded" } export class HttpClient < SecurityDataType = unknown > { public baseUrl : string = "https://io.adafruit.com/api/v2" ; private securityData : SecurityDataType | null = null ; private securityWorker ? : ApiConfig < SecurityDataType > [ "securityWorker" ] ; private abortControllers = new Map < CancelToken , AbortController > ( ) ; private customFetch = ( ... fetchParams ) => fetch ( ... fetchParams ) ; private baseApiParams : RequestParams = { credentials : "same-origin" , headers : { } , redirect : "follow" , referrerPolicy : "no-referrer" , } ; constructor ( apiConfig = { } ) { Object . assign ( this , apiConfig ) ; } public setSecurityData = ( data ) => { this . securityData = data ; } ; private encodeQueryParam ( key , value ) { const encodedKey = encodeURIComponent ( key ) ; return `${ encodedKey }=${ encodeURIComponent ( typeof value === "number" ? value : `${ value }` ) }` ; } private addQueryParam ( query , key ) { return this . encodeQueryParam ( key , query [ key ] ) ; } private addArrayQueryParam ( query , key ) { const value = query [ key ] ; return value . map ( ( v ) => this . encodeQueryParam ( key , v ) ) . join ( "&" ) ; } protected toQueryString ( rawQuery ? ) { const query = rawQuery || { } ; const keys = Object . keys ( query ) . filter ( ( key ) => "undefined" !== typeof query [ key ] ) ; return keys . map ( ( key ) => ( Array . isArray ( query [ key ] ) ? this . addArrayQueryParam ( query , key ) : this . addQueryParam ( query , key ) ) ) . join ( "&" ) ; } protected addQueryParams ( rawQuery ? ) { const queryString = this . toQueryString ( rawQuery ) ; return queryString ? `?${ queryString }` : "" ; } private contentFormatters : Record < ContentType , ( input : any ) => any > = { [ ContentType . Json ] : ( input ) => input !== null && ( typeof input === "object" || typeof input === "string" ) ? JSON . stringify ( input ) : input , [ ContentType . FormData ] : ( input ) => Object . keys ( input || { } ) . reduce ( ( formData , key ) => { const property = input [ key ] ; formData . append ( key , property instanceof Blob ? property : typeof property === "object" && property !== null ? JSON . stringify ( property ) : `${ property }` ) ; return formData ; } , new FormData ( ) ) , [ ContentType . UrlEncoded ] : ( input ) => this . toQueryString ( input ) , } ; private mergeRequestParams ( params1 , params2 ? ) { return { ... this . baseApiParams , ... params1 , ... ( params2 || { } ) , headers : { ... ( this . baseApiParams . headers || { } ) , ... ( params1 . headers || { } ) , ... ( ( params2 && params2 . headers ) || { } ) , } , } ; } private createAbortSignal = ( cancelToken ) : AbortSignal | undefined => { if ( this . abortControllers . has ( cancelToken ) ) { const abortController = this . abortControllers . get ( cancelToken ) ; if ( abortController ) { return abortController . signal ; } return void 0 ; } const abortController = new AbortController ( ) ; this . abortControllers . set ( cancelToken , abortController ) ; return abortController . signal ; } ; public abortRequest = ( cancelToken ) => { const abortController = this . abortControllers . get ( cancelToken ) ; if ( abortController ) { abortController . abort ( ) ; this . abortControllers . delete ( cancelToken ) ; } } ; public request = async < T = any , E = any > ( { body , secure , path , type , query , format , baseUrl , cancelToken , ... params } ) : Promise < HttpResponse < T , E > > => { const secureParams = ( ( typeof secure === "boolean" ? secure : this . baseApiParams . secure ) && this . securityWorker && ( await this . securityWorker ( this . securityData ) ) ) || { } ; const requestParams = this . mergeRequestParams ( params , secureParams ) ; const queryString = query && this . toQueryString ( query ) ; const payloadFormatter = this . contentFormatters [ type || ContentType . Json ] ; const responseFormat = format || requestParams . format ; return this . customFetch ( `${ baseUrl || this . baseUrl || "" }${ path }${ queryString ? `?${ queryString }` : "" }` , { ... requestParams , headers : { ... ( type && type !== ContentType . FormData ? { "Content-Type" : type } : { } ) , ... ( requestParams . headers || { } ) , } , signal : cancelToken ? this . createAbortSignal ( cancelToken ) : void 0 , body : typeof body === "undefined" || body === null ? null : payloadFormatter ( body ) , } ) . then ( async ( response ) => { const r = response as HttpResponse < T , E > ; r . data = ( null as unknown ) as T ; r . error = ( null as unknown ) as E ; const data = ! responseFormat ? r : await response [ responseFormat ] ( ) . then ( ( data ) => { if ( r . ok ) { r . data = data ; } else { r . error = data ; } return r ; } ) . catch ( ( e ) => { r . error = e ; return r ; } ) ; if ( cancelToken ) { this . abortControllers . delete ( cancelToken ) ; } if ( ! response . ok ) throw data ; return data ; } ) ; } ; } title version baseUrl export class Api < SecurityDataType extends unknown > extends HttpClient < SecurityDataType > { user = { tags name summary request secure currentUser : ( params = { } ) => this . request < User , void > ( { path : `/user` , method : "GET" , secure : true , format : "json" , ... params , } ) , } ; webhooks = { tags name summary request secure createWebhookFeedData : ( token , payload , params = { } ) => this . request < Data , void > ( { path : `/webhooks/feed/${ token }` , method : "POST" , body : payload , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure createRawWebhookFeedData : ( token , params = { } ) => this . request < Data , void > ( { path : `/webhooks/feed/${ token }/raw` , method : "POST" , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , } ; username = { description tags name summary request secure destroyActivities : ( username , params = { } ) => this . request < void , void > ( { path : `/${ username }/activities` , method : "DELETE" , secure : true , ... params , } ) , description tags name summary request secure allActivities : ( username , query ? , params = { } ) => this . request < Activity [ ] , void > ( { path : `/${ username }/activities` , method : "GET" , query : query , secure : true , format : "json" , ... params , } ) , description tags name summary request secure getActivity : ( username , type , query ? , params = { } ) => this . request < Activity [ ] , void > ( { path : `/${ username }/activities/${ type }` , method : "GET" , query : query , secure : true , format : "json" , ... params , } ) , description tags name summary request secure allDashboards : ( username , params = { } ) => this . request < Dashboard [ ] , void > ( { path : `/${ username }/dashboards` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure createDashboard : ( username , dashboard , params = { } ) => this . request < Dashboard , void > ( { path : `/${ username }/dashboards` , method : "POST" , body : dashboard , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure allBlocks : ( username , dashboardId , params = { } ) => this . request < Block [ ] , void > ( { path : `/${ username }/dashboards/${ dashboardId }/blocks` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure createBlock : ( username , dashboardId , block , params = { } ) => this . request < Block , void > ( { path : `/${ username }/dashboards/${ dashboardId }/blocks` , method : "POST" , body : block , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure destroyBlock : ( username , dashboardId , id , params = { } ) => this . request < string , void > ( { path : `/${ username }/dashboards/${ dashboardId }/blocks/${ id }` , method : "DELETE" , secure : true , format : "json" , ... params , } ) , tags name summary request secure getBlock : ( username , dashboardId , id , params = { } ) => this . request < Block , void > ( { path : `/${ username }/dashboards/${ dashboardId }/blocks/${ id }` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure updateBlock : ( username , dashboardId , id , block , params = { } ) => this . request < Block , void > ( { path : `/${ username }/dashboards/${ dashboardId }/blocks/${ id }` , method : "PATCH" , body : block , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure replaceBlock : ( username , dashboardId , id , block , params = { } ) => this . request < Block , void > ( { path : `/${ username }/dashboards/${ dashboardId }/blocks/${ id }` , method : "PUT" , body : block , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure destroyDashboard : ( username , id , params = { } ) => this . request < string , void > ( { path : `/${ username }/dashboards/${ id }` , method : "DELETE" , secure : true , format : "json" , ... params , } ) , tags name summary request secure getDashboard : ( username , id , params = { } ) => this . request < Dashboard , void > ( { path : `/${ username }/dashboards/${ id }` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure updateDashboard : ( username , id , dashboard , params = { } ) => this . request < Dashboard , void > ( { path : `/${ username }/dashboards/${ id }` , method : "PATCH" , body : dashboard , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure replaceDashboard : ( username , id , dashboard , params = { } ) => this . request < Dashboard , void > ( { path : `/${ username }/dashboards/${ id }` , method : "PUT" , body : dashboard , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure allFeeds : ( username , params = { } ) => this . request < Feed [ ] , void > ( { path : `/${ username }/feeds` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure createFeed : ( username , feed , query ? , params = { } ) => this . request < Feed , void > ( { path : `/${ username }/feeds` , method : "POST" , query : query , body : feed , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure destroyFeed : ( username , feedKey , params = { } ) => this . request < void , void > ( { path : `/${ username }/feeds/${ feedKey }` , method : "DELETE" , secure : true , ... params , } ) , description tags name summary request secure getFeed : ( username , feedKey , params = { } ) => this . request < Feed , void > ( { path : `/${ username }/feeds/${ feedKey }` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure updateFeed : ( username , feedKey , feed , params = { } ) => this . request < Feed , void > ( { path : `/${ username }/feeds/${ feedKey }` , method : "PATCH" , body : feed , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure replaceFeed : ( username , feedKey , feed , params = { } ) => this . request < Feed , void > ( { path : `/${ username }/feeds/${ feedKey }` , method : "PUT" , body : feed , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure allData : ( username , feedKey , query ? , params = { } ) => this . request < DataResponse [ ] , void > ( { path : `/${ username }/feeds/${ feedKey }/data` , method : "GET" , query : query , secure : true , format : "json" , ... params , } ) , description tags name summary request secure createData : ( username , feedKey , datum , params = { } ) => this . request < Data , void > ( { path : `/${ username }/feeds/${ feedKey }/data` , method : "POST" , body : datum , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure batchCreateData : ( username , feedKey , data , params = { } ) => this . request < DataResponse [ ] , void > ( { path : `/${ username }/feeds/${ feedKey }/data/batch` , method : "POST" , body : data , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure chartData : ( username , feedKey , query ? , params = { } ) => this . request < { columns ? : string [ ] ; data ? : string [ ] [ ] ; feed ? : { id ? : number ; key ? : string ; name ? : string ; } ; parameters ? : object ; } , void > ( { path : `/${ username }/feeds/${ feedKey }/data/chart` , method : "GET" , query : query , secure : true , format : "json" , ... params , } ) , description tags name summary request secure firstData : ( username , feedKey , query ? , params = { } ) => this . request < DataResponse , void > ( { path : `/${ username }/feeds/${ feedKey }/data/first` , method : "GET" , query : query , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure lastData : ( username , feedKey , query ? , params = { } ) => this . request < DataResponse , void > ( { path : `/${ username }/feeds/${ feedKey }/data/last` , method : "GET" , query : query , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure nextData : ( username , feedKey , query ? , params = { } ) => this . request < DataResponse , void > ( { path : `/${ username }/feeds/${ feedKey }/data/next` , method : "GET" , query : query , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure previousData : ( username , feedKey , query ? , params = { } ) => this . request < DataResponse , void > ( { path : `/${ username }/feeds/${ feedKey }/data/previous` , method : "GET" , query : query , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure retainData : ( username , feedKey , params = { } ) => this . request < string , void > ( { path : `/${ username }/feeds/${ feedKey }/data/retain` , method : "GET" , secure : true , type : ContentType . Json , ... params , } ) , tags name summary request secure destroyData : ( username , feedKey , id , params = { } ) => this . request < string , void > ( { path : `/${ username }/feeds/${ feedKey }/data/${ id }` , method : "DELETE" , secure : true , format : "json" , ... params , } ) , tags name summary request secure getData : ( username , feedKey , id , query ? , params = { } ) => this . request < DataResponse , void > ( { path : `/${ username }/feeds/${ feedKey }/data/${ id }` , method : "GET" , query : query , secure : true , format : "json" , ... params , } ) , tags name summary request secure updateData : ( username , feedKey , id , datum , params = { } ) => this . request < DataResponse , void > ( { path : `/${ username }/feeds/${ feedKey }/data/${ id }` , method : "PATCH" , body : datum , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure replaceData : ( username , feedKey , id , datum , params = { } ) => this . request < DataResponse , void > ( { path : `/${ username }/feeds/${ feedKey }/data/${ id }` , method : "PUT" , body : datum , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure getFeedDetails : ( username , feedKey , params = { } ) => this . request < Feed , void > ( { path : `/${ username }/feeds/${ feedKey }/details` , method : "GET" , secure : true , format : "json" , ... params , } ) , description tags name summary request secure allGroups : ( username , params = { } ) => this . request < Group [ ] , void > ( { path : `/${ username }/groups` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure createGroup : ( username , group , params = { } ) => this . request < Group , void > ( { path : `/${ username }/groups` , method : "POST" , body : group , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure destroyGroup : ( username , groupKey , params = { } ) => this . request < string , void > ( { path : `/${ username }/groups/${ groupKey }` , method : "DELETE" , secure : true , format : "json" , ... params , } ) , tags name summary request secure getGroup : ( username , groupKey , params = { } ) => this . request < Group , void > ( { path : `/${ username }/groups/${ groupKey }` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure updateGroup : ( username , groupKey , group , params = { } ) => this . request < Group , void > ( { path : `/${ username }/groups/${ groupKey }` , method : "PATCH" , body : group , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure replaceGroup : ( username , groupKey , group , params = { } ) => this . request < Group , void > ( { path : `/${ username }/groups/${ groupKey }` , method : "PUT" , body : group , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure addFeedToGroup : ( groupKey , username , query ? , params = { } ) => this . request < Group , void > ( { path : `/${ username }/groups/${ groupKey }/add` , method : "POST" , query : query , secure : true , format : "json" , ... params , } ) , tags name summary request secure createGroupData : ( username , groupKey , group_feed_data , params = { } ) => this . request < DataResponse [ ] , void > ( { path : `/${ username }/groups/${ groupKey }/data` , method : "POST" , body : group_feed_data , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure allGroupFeeds : ( groupKey , username , params = { } ) => this . request < Feed [ ] , void > ( { path : `/${ username }/groups/${ groupKey }/feeds` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure createGroupFeed : ( username , groupKey , feed , params = { } ) => this . request < Feed , void > ( { path : `/${ username }/groups/${ groupKey }/feeds` , method : "POST" , body : feed , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure allGroupFeedData : ( username , groupKey , feedKey , query ? , params = { } ) => this . request < DataResponse [ ] , void > ( { path : `/${ username }/groups/${ groupKey }/feeds/${ feedKey }/data` , method : "GET" , query : query , secure : true , format : "json" , ... params , } ) , tags name summary request secure createGroupFeedData : ( username , groupKey , feedKey , datum , params = { } ) => this . request < DataResponse , void > ( { path : `/${ username }/groups/${ groupKey }/feeds/${ feedKey }/data` , method : "POST" , body : datum , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure batchCreateGroupFeedData : ( username , groupKey , feedKey , data , params = { } ) => this . request < DataResponse [ ] , void > ( { path : `/${ username }/groups/${ groupKey }/feeds/${ feedKey }/data/batch` , method : "POST" , body : data , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure removeFeedFromGroup : ( groupKey , username , query ? , params = { } ) => this . request < Group , void > ( { path : `/${ username }/groups/${ groupKey }/remove` , method : "POST" , query : query , secure : true , format : "json" , ... params , } ) , tags name summary request secure getCurrentUserThrottle : ( username , params = { } ) => this . request < { active_data_rate ? : number ; data_rate_limit ? : number ; } , void > ( { path : `/${ username }/throttle` , method : "GET" , secure : true , format : "json" , ... params , } ) , description tags name summary request secure allTokens : ( username , params = { } ) => this . request < Token [ ] , void > ( { path : `/${ username }/tokens` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure createToken : ( username , token , params = { } ) => this . request < Token , void > ( { path : `/${ username }/tokens` , method : "POST" , body : token , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure destroyToken : ( username , id , params = { } ) => this . request < string , void > ( { path : `/${ username }/tokens/${ id }` , method : "DELETE" , secure : true , format : "json" , ... params , } ) , tags name summary request secure getToken : ( username , id , params = { } ) => this . request < Token , void > ( { path : `/${ username }/tokens/${ id }` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure updateToken : ( username , id , token , params = { } ) => this . request < Token , void > ( { path : `/${ username }/tokens/${ id }` , method : "PATCH" , body : token , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure replaceToken : ( username , id , token , params = { } ) => this . request < Token , void > ( { path : `/${ username }/tokens/${ id }` , method : "PUT" , body : token , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure allTriggers : ( username , params = { } ) => this . request < Trigger [ ] , void > ( { path : `/${ username }/triggers` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure createTrigger : ( username , trigger , params = { } ) => this . request < Trigger , void > ( { path : `/${ username }/triggers` , method : "POST" , body : trigger , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure destroyTrigger : ( username , id , params = { } ) => this . request < string , void > ( { path : `/${ username }/triggers/${ id }` , method : "DELETE" , secure : true , format : "json" , ... params , } ) , tags name summary request secure getTrigger : ( username , id , params = { } ) => this . request < Trigger , void > ( { path : `/${ username }/triggers/${ id }` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure updateTrigger : ( username , id , trigger , params = { } ) => this . request < Trigger , void > ( { path : `/${ username }/triggers/${ id }` , method : "PATCH" , body : trigger , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure replaceTrigger : ( username , id , trigger , params = { } ) => this . request < Trigger , void > ( { path : `/${ username }/triggers/${ id }` , method : "PUT" , body : trigger , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , description tags name summary request secure allPermissions : ( username , type , typeId , params = { } ) => this . request < Permission [ ] , void > ( { path : `/${ username }/${ type }/${ typeId }/acl` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure createPermission : ( username , type , typeId , permission , params = { } ) => this . request < Permission , void > ( { path : `/${ username }/${ type }/${ typeId }/acl` , method : "POST" , body : permission , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure destroyPermission : ( username , type , typeId , id , params = { } ) => this . request < string , void > ( { path : `/${ username }/${ type }/${ typeId }/acl/${ id }` , method : "DELETE" , secure : true , format : "json" , ... params , } ) , tags name summary request secure getPermission : ( username , type , typeId , id , params = { } ) => this . request < Permission , void > ( { path : `/${ username }/${ type }/${ typeId }/acl/${ id }` , method : "GET" , secure : true , format : "json" , ... params , } ) , tags name summary request secure updatePermission : ( username , type , typeId , id , permission , params = { } ) => this . request < Permission , void > ( { path : `/${ username }/${ type }/${ typeId }/acl/${ id }` , method : "PATCH" , body : permission , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , tags name summary request secure replacePermission : ( username , type , typeId , id , permission , params = { } ) => this . request < Permission , void > ( { path : `/${ username }/${ type }/${ typeId }/acl/${ id }` , method : "PUT" , body : permission , secure : true , type : ContentType . Json , format : "json" , ... params , } ) , } ; }