-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from Asana/rossgrambo-openapi-conversion-conse…
…rvative Rossgrambo openapi conversion conservative
- Loading branch information
Showing
53 changed files
with
5,430 additions
and
2,108 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Swagger Codegen Ignore | ||
|
||
docs/* | ||
src/test/java/com/asana/resources/gen/* |
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 |
---|---|---|
|
@@ -2,5 +2,4 @@ language: java | |
dist: trusty | ||
jdk: | ||
- oraclejdk8 | ||
- openjdk7 | ||
- openjdk8 |
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,10 @@ | ||
package com.asana.resources; | ||
|
||
import com.asana.Client; | ||
import com.asana.resources.gen.BatchApiBase; | ||
|
||
public class BatchApis extends BatchApiBase { | ||
public BatchApis(Client client) { | ||
super(client); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/asana/resources/CustomFieldSettings.java
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 |
---|---|---|
@@ -1,10 +1,36 @@ | ||
package com.asana.resources; | ||
|
||
import com.asana.Client; | ||
import com.asana.models.CustomFieldSetting; | ||
import com.asana.requests.CollectionRequest; | ||
import com.asana.resources.gen.CustomFieldSettingsBase; | ||
|
||
public class CustomFieldSettings extends CustomFieldSettingsBase { | ||
public CustomFieldSettings(Client client) { | ||
super(client); | ||
} | ||
|
||
/** | ||
* Returns a list of all of the custom fields settings on a project. | ||
* | ||
* @param project The ID of the project for which to list custom field settings | ||
* @return Request object | ||
*/ | ||
public CollectionRequest<CustomFieldSetting> findByProject(String project) { | ||
|
||
String path = String.format("/projects/%s/custom_field_settings", project); | ||
return new CollectionRequest<CustomFieldSetting>(this, CustomFieldSetting.class, path, "GET"); | ||
} | ||
|
||
/** | ||
* Returns a list of all of the custom fields settings on a portfolio. | ||
* | ||
* @param portfolio The ID of the portfolio for which to list custom field settings | ||
* @return Request object | ||
*/ | ||
public CollectionRequest<CustomFieldSetting> findByPortfolio(String portfolio) { | ||
|
||
String path = String.format("/portfolios/%s/custom_field_settings", portfolio); | ||
return new CollectionRequest<CustomFieldSetting>(this, CustomFieldSetting.class, path, "GET"); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,118 @@ | ||
package com.asana.resources; | ||
|
||
import com.asana.Client; | ||
import com.asana.models.CustomField; | ||
import com.asana.requests.CollectionRequest; | ||
import com.asana.requests.ItemRequest; | ||
import com.asana.resources.gen.CustomFieldsBase; | ||
|
||
public class CustomFields extends CustomFieldsBase { | ||
public CustomFields(Client client) { | ||
super(client); | ||
} | ||
|
||
/** | ||
* Creates a new custom field in a workspace. Every custom field is required to be created in a specific workspace, and this workspace cannot be changed once set. | ||
* | ||
* A custom field's `name` must be unique within a workspace and not conflict with names of existing task properties such as 'Due Date' or 'Assignee'. A custom field's `type` must be one of 'text', 'enum', or 'number'. | ||
* | ||
* Returns the full record of the newly created custom field. | ||
* | ||
* @return Request object | ||
*/ | ||
public ItemRequest<CustomField> create() { | ||
|
||
return new ItemRequest<CustomField>(this, CustomField.class, "/custom_fields", "POST"); | ||
} | ||
|
||
/** | ||
* Returns the complete definition of a custom field's metadata. | ||
* | ||
* @param customField Globally unique identifier for the custom field. | ||
* @return Request object | ||
*/ | ||
public ItemRequest<CustomField> findById(String customField) { | ||
|
||
String path = String.format("/custom_fields/%s", customField); | ||
return new ItemRequest<CustomField>(this, CustomField.class, path, "GET"); | ||
} | ||
|
||
/** | ||
* Returns a list of the compact representation of all of the custom fields in a workspace. | ||
* | ||
* @param workspace The workspace or organization to find custom field definitions in. | ||
* @return Request object | ||
*/ | ||
public CollectionRequest<CustomField> findByWorkspace(String workspace) { | ||
|
||
String path = String.format("/workspaces/%s/custom_fields", workspace); | ||
return new CollectionRequest<CustomField>(this, CustomField.class, path, "GET"); | ||
} | ||
|
||
/** | ||
* A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged | ||
* | ||
* When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. | ||
* | ||
* An enum custom field's `enum_options` cannot be updated with this endpoint. Instead see "Work With Enum Options" for information on how to update `enum_options`. | ||
* | ||
* Locked custom fields can only be updated by the user who locked the field. | ||
* | ||
* Returns the complete updated custom field record. | ||
* | ||
* @param customField Globally unique identifier for the custom field. | ||
* @return Request object | ||
*/ | ||
public ItemRequest<CustomField> update(String customField) { | ||
|
||
String path = String.format("/custom_fields/%s", customField); | ||
return new ItemRequest<CustomField>(this, CustomField.class, path, "PUT"); | ||
} | ||
|
||
/** | ||
* A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. | ||
* | ||
* Locked custom fields can only be deleted by the user who locked the field. | ||
* | ||
* Returns an empty data record. | ||
* | ||
* @param customField Globally unique identifier for the custom field. | ||
* @return Request object | ||
*/ | ||
public ItemRequest<CustomField> delete(String customField) { | ||
|
||
String path = String.format("/custom_fields/%s", customField); | ||
return new ItemRequest<CustomField>(this, CustomField.class, path, "DELETE"); | ||
} | ||
|
||
/** | ||
* Creates an enum option and adds it to this custom field's list of enum options. A custom field can have at most 50 enum options (including disabled options). By default new enum options are inserted at the end of a custom field's list. | ||
* | ||
* Locked custom fields can only have enum options added by the user who locked the field. | ||
* | ||
* Returns the full record of the newly created enum option. | ||
* | ||
* @param customField Globally unique identifier for the custom field. | ||
* @return Request object | ||
*/ | ||
public ItemRequest<CustomField> createEnumOption(String customField) { | ||
|
||
String path = String.format("/custom_fields/%s/enum_options", customField); | ||
return new ItemRequest<CustomField>(this, CustomField.class, path, "POST"); | ||
} | ||
|
||
/** | ||
* Moves a particular enum option to be either before or after another specified enum option in the custom field. | ||
* | ||
* Locked custom fields can only be reordered by the user who locked the field. | ||
* | ||
* @param customField Globally unique identifier for the custom field. | ||
* @return Request object | ||
*/ | ||
public ItemRequest<CustomField> insertEnumOption(String customField) { | ||
|
||
String path = String.format("/custom_fields/%s/enum_options/insert", customField); | ||
return new ItemRequest<CustomField>(this, CustomField.class, path, "POST"); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,10 +1,24 @@ | ||
package com.asana.resources; | ||
|
||
import com.asana.Client; | ||
import com.asana.models.Job; | ||
import com.asana.requests.ItemRequest; | ||
import com.asana.resources.gen.JobsBase; | ||
|
||
public class Jobs extends JobsBase { | ||
public Jobs(Client client) { | ||
super(client); | ||
} | ||
|
||
/** | ||
* Returns the complete job record for a single job. | ||
* | ||
* @param job The job to get. | ||
* @return Request object | ||
*/ | ||
public ItemRequest<Job> findById(String job) { | ||
|
||
String path = String.format("/jobs/%s", job); | ||
return new ItemRequest<Job>(this, Job.class, path, "GET"); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/asana/resources/OrganizationExports.java
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 |
---|---|---|
@@ -1,10 +1,35 @@ | ||
package com.asana.resources; | ||
|
||
import com.asana.Client; | ||
import com.asana.models.OrganizationExport; | ||
import com.asana.requests.ItemRequest; | ||
import com.asana.resources.gen.OrganizationExportsBase; | ||
|
||
public class OrganizationExports extends OrganizationExportsBase { | ||
public OrganizationExports(Client client) { | ||
super(client); | ||
} | ||
|
||
/** | ||
* Returns details of a previously-requested Organization export. | ||
* | ||
* @param organizationExport Globally unique identifier for the Organization export. | ||
* @return Request object | ||
*/ | ||
public ItemRequest<OrganizationExport> findById(String organizationExport) { | ||
|
||
String path = String.format("/organization_exports/%s", organizationExport); | ||
return new ItemRequest<OrganizationExport>(this, OrganizationExport.class, path, "GET"); | ||
} | ||
|
||
/** | ||
* This method creates a request to export an Organization. Asana will complete the export at some | ||
* point after you create the request. | ||
* | ||
* @return Request object | ||
*/ | ||
public ItemRequest<OrganizationExport> create() { | ||
|
||
return new ItemRequest<OrganizationExport>(this, OrganizationExport.class, "/organization_exports", "POST"); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/asana/resources/PortfolioMemberships.java
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 |
---|---|---|
@@ -1,10 +1,48 @@ | ||
package com.asana.resources; | ||
|
||
import com.asana.Client; | ||
import com.asana.models.PortfolioMembership; | ||
import com.asana.requests.CollectionRequest; | ||
import com.asana.requests.ItemRequest; | ||
import com.asana.resources.gen.PortfolioMembershipsBase; | ||
|
||
public class PortfolioMemberships extends PortfolioMembershipsBase { | ||
public PortfolioMemberships(Client client) { | ||
super(client); | ||
} | ||
|
||
/** | ||
* Returns the compact portfolio membership records for the portfolio. You must | ||
* specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`. | ||
* | ||
* @return Request object | ||
*/ | ||
public CollectionRequest<PortfolioMembership> findAll() { | ||
|
||
return new CollectionRequest<PortfolioMembership>(this, PortfolioMembership.class, "/portfolio_memberships", "GET"); | ||
} | ||
|
||
/** | ||
* Returns the compact portfolio membership records for the portfolio. | ||
* | ||
* @param portfolio The portfolio for which to fetch memberships. | ||
* @return Request object | ||
*/ | ||
public CollectionRequest<PortfolioMembership> findByPortfolio(String portfolio) { | ||
|
||
String path = String.format("/portfolios/%s/portfolio_memberships", portfolio); | ||
return new CollectionRequest<PortfolioMembership>(this, PortfolioMembership.class, path, "GET"); | ||
} | ||
|
||
/** | ||
* Returns the portfolio membership record. | ||
* | ||
* @param portfolioMembership Globally unique identifier for the portfolio membership. | ||
* @return Request object | ||
*/ | ||
public ItemRequest<PortfolioMembership> findById(String portfolioMembership) { | ||
|
||
String path = String.format("/portfolio_memberships/%s", portfolioMembership); | ||
return new ItemRequest<PortfolioMembership>(this, PortfolioMembership.class, path, "GET"); | ||
} | ||
} |
Oops, something went wrong.