asana 0.1.1

asana bindings for rust
Documentation
# \CustomFieldsApi

All URIs are relative to *https://app.asana.com/api/1.0*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_custom_field**](CustomFieldsApi.md#create_custom_field) | **post** /custom_fields | Create a custom field
[**create_enum_option_for_custom_field**](CustomFieldsApi.md#create_enum_option_for_custom_field) | **post** /custom_fields/{custom_field_gid}/enum_options | Create an enum option
[**delete_custom_field**](CustomFieldsApi.md#delete_custom_field) | **delete** /custom_fields/{custom_field_gid} | Delete a custom field
[**get_custom_field**](CustomFieldsApi.md#get_custom_field) | **get** /custom_fields/{custom_field_gid} | Get a custom field
[**get_custom_fields_for_workspace**](CustomFieldsApi.md#get_custom_fields_for_workspace) | **get** /workspaces/{workspace_gid}/custom_fields | Get a workspace's custom fields
[**insert_enum_option_for_custom_field**](CustomFieldsApi.md#insert_enum_option_for_custom_field) | **post** /custom_fields/{custom_field_gid}/enum_options/insert | Reorder a custom field's enum
[**update_custom_field**](CustomFieldsApi.md#update_custom_field) | **put** /custom_fields/{custom_field_gid} | Update a custom field
[**update_enum_option**](CustomFieldsApi.md#update_enum_option) | **put** /enum_options/{enum_option_gid} | Update an enum option



## create_custom_field

> crate::models::InlineResponse201 create_custom_field(opt_pretty, opt_fields, limit, offset, inline_object1)
Create a custom field

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.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**opt_pretty** | Option<**bool**> | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |  |
**opt_fields** | Option<[**Vec<String>**](String.md)> | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. |  |
**limit** | Option<**i32**> | Results per page. The number of objects to return per page. The value must be between 1 and 100. |  |
**offset** | Option<**String**> | Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' |  |
**inline_object1** | Option<[**InlineObject1**](InlineObject1.md)> |  |  |

### Return type

[**crate::models::InlineResponse201**](inline_response_201.md)

### Authorization

[oauth2](../README.md#oauth2), [personalAccessToken](../README.md#personalAccessToken)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## create_enum_option_for_custom_field

> crate::models::InlineResponse2011 create_enum_option_for_custom_field(custom_field_gid, opt_pretty, opt_fields, limit, offset, inline_object3)
Create an enum option

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.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**custom_field_gid** | **String** | Globally unique identifier for the custom field. | [required] |
**opt_pretty** | Option<**bool**> | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |  |
**opt_fields** | Option<[**Vec<String>**](String.md)> | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. |  |
**limit** | Option<**i32**> | Results per page. The number of objects to return per page. The value must be between 1 and 100. |  |
**offset** | Option<**String**> | Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' |  |
**inline_object3** | Option<[**InlineObject3**](InlineObject3.md)> |  |  |

### Return type

[**crate::models::InlineResponse2011**](inline_response_201_1.md)

### Authorization

[oauth2](../README.md#oauth2), [personalAccessToken](../README.md#personalAccessToken)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## delete_custom_field

> crate::models::InlineResponse2001 delete_custom_field(custom_field_gid, opt_pretty, opt_fields)
Delete a custom field

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.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**custom_field_gid** | **String** | Globally unique identifier for the custom field. | [required] |
**opt_pretty** | Option<**bool**> | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |  |
**opt_fields** | Option<[**Vec<String>**](String.md)> | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. |  |

### Return type

[**crate::models::InlineResponse2001**](inline_response_200_1.md)

### Authorization

[oauth2](../README.md#oauth2), [personalAccessToken](../README.md#personalAccessToken)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_custom_field

> crate::models::InlineResponse201 get_custom_field(custom_field_gid, opt_pretty, opt_fields)
Get a custom field

Get the complete definition of a custom field’s metadata.  Since custom fields can be defined for one of a number of types, and these types have different data and behaviors, there are fields that are relevant to a particular type. For instance, as noted above, enum_options is only relevant for the enum type and defines the set of choices that the enum could represent. The examples below show some of these type-specific custom field definitions.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**custom_field_gid** | **String** | Globally unique identifier for the custom field. | [required] |
**opt_pretty** | Option<**bool**> | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |  |
**opt_fields** | Option<[**Vec<String>**](String.md)> | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. |  |

### Return type

[**crate::models::InlineResponse201**](inline_response_201.md)

### Authorization

[oauth2](../README.md#oauth2), [personalAccessToken](../README.md#personalAccessToken)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_custom_fields_for_workspace

> crate::models::InlineResponse2005 get_custom_fields_for_workspace(workspace_gid, opt_pretty, opt_fields, limit, offset)
Get a workspace's custom fields

Returns a list of the compact representation of all of the custom fields in a workspace.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**workspace_gid** | **String** | Globally unique identifier for the workspace or organization. | [required] |
**opt_pretty** | Option<**bool**> | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |  |
**opt_fields** | Option<[**Vec<String>**](String.md)> | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. |  |
**limit** | Option<**i32**> | Results per page. The number of objects to return per page. The value must be between 1 and 100. |  |
**offset** | Option<**String**> | Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' |  |

### Return type

[**crate::models::InlineResponse2005**](inline_response_200_5.md)

### Authorization

[oauth2](../README.md#oauth2), [personalAccessToken](../README.md#personalAccessToken)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## insert_enum_option_for_custom_field

> crate::models::InlineResponse2011 insert_enum_option_for_custom_field(custom_field_gid, opt_pretty, opt_fields, inline_object4)
Reorder a custom field's enum

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.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**custom_field_gid** | **String** | Globally unique identifier for the custom field. | [required] |
**opt_pretty** | Option<**bool**> | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |  |
**opt_fields** | Option<[**Vec<String>**](String.md)> | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. |  |
**inline_object4** | Option<[**InlineObject4**](InlineObject4.md)> |  |  |

### Return type

[**crate::models::InlineResponse2011**](inline_response_201_1.md)

### Authorization

[oauth2](../README.md#oauth2), [personalAccessToken](../README.md#personalAccessToken)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## update_custom_field

> crate::models::InlineResponse201 update_custom_field(custom_field_gid, opt_pretty, opt_fields, inline_object2)
Update a custom field

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. A custom field’s `type` cannot be updated. 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.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**custom_field_gid** | **String** | Globally unique identifier for the custom field. | [required] |
**opt_pretty** | Option<**bool**> | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |  |
**opt_fields** | Option<[**Vec<String>**](String.md)> | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. |  |
**inline_object2** | Option<[**InlineObject2**](InlineObject2.md)> |  |  |

### Return type

[**crate::models::InlineResponse201**](inline_response_201.md)

### Authorization

[oauth2](../README.md#oauth2), [personalAccessToken](../README.md#personalAccessToken)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## update_enum_option

> crate::models::InlineResponse2011 update_enum_option(enum_option_gid, opt_pretty, opt_fields, inline_object5)
Update an enum option

Updates an existing enum option. Enum custom fields require at least one enabled enum option. Locked custom fields can only be updated by the user who locked the field. Returns the full record of the updated enum option.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**enum_option_gid** | **String** | Globally unique identifier for the enum option. | [required] |
**opt_pretty** | Option<**bool**> | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |  |
**opt_fields** | Option<[**Vec<String>**](String.md)> | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. |  |
**inline_object5** | Option<[**InlineObject5**](InlineObject5.md)> |  |  |

### Return type

[**crate::models::InlineResponse2011**](inline_response_201_1.md)

### Authorization

[oauth2](../README.md#oauth2), [personalAccessToken](../README.md#personalAccessToken)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)