-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add technology_type index function (#49)
- Loading branch information
Showing
10 changed files
with
141 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Patch API V1 | ||
* The core API used to integrate with Patch's service | ||
* | ||
* Contact: developers@usepatch.com | ||
*/ | ||
|
||
import ApiClient from '../ApiClient'; | ||
import TechnologyTypeListResponse from '../model/TechnologyTypeListResponse'; | ||
|
||
export default class TechnologyTypesApi { | ||
constructor(apiClient) { | ||
this.apiClient = apiClient || ApiClient.instance; | ||
} | ||
|
||
retrieveTechnologyTypesWithHttpInfo() { | ||
let postBody = null; | ||
|
||
let pathParams = {}; | ||
let queryParams = {}; | ||
let headerParams = {}; | ||
let formParams = {}; | ||
|
||
let authNames = ['bearer_auth']; | ||
let contentTypes = []; | ||
let accepts = ['application/json']; | ||
let returnType = TechnologyTypeListResponse; | ||
|
||
return this.apiClient.callApi( | ||
'/v1/projects/technology_types', | ||
'GET', | ||
pathParams, | ||
queryParams, | ||
headerParams, | ||
formParams, | ||
postBody, | ||
authNames, | ||
contentTypes, | ||
accepts, | ||
returnType | ||
); | ||
} | ||
|
||
retrieveTechnologyTypes() { | ||
return this.retrieveTechnologyTypesWithHttpInfo(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Patch API V1 | ||
* The core API used to integrate with Patch's service | ||
* | ||
* Contact: developers@usepatch.com | ||
*/ | ||
|
||
import ApiClient from '../ApiClient'; | ||
import TechnologyType from './TechnologyType'; | ||
|
||
class TechnologyTypeListResponse { | ||
constructor(success, error, data) { | ||
TechnologyTypeListResponse.initialize(this, success, error, data); | ||
} | ||
|
||
static initialize(obj, success, error, data) { | ||
obj['success'] = success; | ||
obj['error'] = error; | ||
obj['data'] = data; | ||
} | ||
|
||
static constructFromObject(data, obj) { | ||
if (data) { | ||
obj = obj || new TechnologyTypeListResponse(); | ||
|
||
if (data.hasOwnProperty('success')) { | ||
obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); | ||
} | ||
|
||
if (data.hasOwnProperty('error')) { | ||
obj['error'] = ApiClient.convertToType(data['error'], Object); | ||
} | ||
|
||
if (data.hasOwnProperty('data')) { | ||
obj['data'] = ApiClient.convertToType(data['data'], [TechnologyType]); | ||
} | ||
} | ||
return obj; | ||
} | ||
} | ||
|
||
TechnologyTypeListResponse.prototype['success'] = undefined; | ||
|
||
TechnologyTypeListResponse.prototype['error'] = undefined; | ||
|
||
TechnologyTypeListResponse.prototype['data'] = undefined; | ||
|
||
export default TechnologyTypeListResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { expect } from 'chai'; | ||
import Patch from '../../../dist/index'; | ||
const patch = Patch(process.env.SANDBOX_API_KEY); | ||
|
||
describe('Projects TechnologyTypes Integration', function () { | ||
it.only('supports fetching the available technology_types', async function () { | ||
const { data } = await patch.technologytypes.retrieveTechnologyTypes(); | ||
expect(data.length).to.be.above(0); | ||
expect(data[0].name).to.be.a('string'); | ||
expect(data[0].slug).to.be.a('string'); | ||
expect(data[0].parent_technology_type.slug).to.be.a('string'); | ||
expect(data[0].parent_technology_type.name).to.be.a('string'); | ||
}); | ||
}); |