Skip to content

Commit

Permalink
Merge pull request #50 from getbrevo/feature_ACC-4880_1
Browse files Browse the repository at this point in the history
ACC-4880: Update getAttribute API + add multiCategoryOptions
  • Loading branch information
sowmyahora2001 authored Jan 16, 2025
2 parents ab71297 + 8dbbb9c commit f4741ee
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 15 deletions.
3 changes: 2 additions & 1 deletion docs/Model/CreateAttribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Name | Type | Description | Notes
**value** | **string** | Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' | [optional]
**isRecurring** | **bool** | Type of the attribute. Use only if the attribute's category is 'calculated' or 'global' | [optional]
**enumeration** | [**\Brevo\Client\Model\CreateAttributeEnumeration[]**](CreateAttributeEnumeration.md) | List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] | [optional]
**type** | **string** | Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) | [optional]
**multiCategoryOptions** | **string[]** | List of options you want to add for multiple-choice attribute. **Use only if the attribute's category is \"normal\" and attribute's type is \"multiple-choice\".** For example: **[\"USA\",\"INDIA\"]** | [optional]
**type** | **string** | Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' and 'multiple-choice' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) | [optional]

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

Expand Down
4 changes: 3 additions & 1 deletion docs/Model/UpdateAttribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **string** | Value of the attribute to update. Use only if the attribute's category is 'calculated' or 'global' | [optional]
**enumeration** | [**\Brevo\Client\Model\UpdateAttributeEnumeration[]**](UpdateAttributeEnumeration.md) | List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, `[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]` | [optional]
**enumeration** | [**\Brevo\Client\Model\UpdateAttributeEnumeration[]**](UpdateAttributeEnumeration.md) | List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] | [optional]
**multiCategoryOptions** | **string[]** | Use this option to add multiple-choice attributes options only if the attribute's category is \"normal\". **This option is specifically designed for updating multiple-choice attributes**. For example: **[\"USA\",\"INDIA\"]** | [optional]


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

Expand Down
36 changes: 34 additions & 2 deletions lib/Model/CreateAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Brevo API
*
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity |
*
* OpenAPI spec version: 3.0.0
* Contact: [email protected]
Expand Down Expand Up @@ -60,6 +60,7 @@ class CreateAttribute implements ModelInterface, ArrayAccess
'value' => 'string',
'isRecurring' => 'bool',
'enumeration' => '\Brevo\Client\Model\CreateAttributeEnumeration[]',
'multiCategoryOptions' => 'string[]',
'type' => 'string'
];

Expand All @@ -72,6 +73,7 @@ class CreateAttribute implements ModelInterface, ArrayAccess
'value' => null,
'isRecurring' => null,
'enumeration' => null,
'multiCategoryOptions' => null,
'type' => null
];

Expand Down Expand Up @@ -105,6 +107,7 @@ public static function swaggerFormats()
'value' => 'value',
'isRecurring' => 'isRecurring',
'enumeration' => 'enumeration',
'multiCategoryOptions' => 'multiCategoryOptions',
'type' => 'type'
];

Expand All @@ -117,6 +120,7 @@ public static function swaggerFormats()
'value' => 'setValue',
'isRecurring' => 'setIsRecurring',
'enumeration' => 'setEnumeration',
'multiCategoryOptions' => 'setMultiCategoryOptions',
'type' => 'setType'
];

Expand All @@ -129,6 +133,7 @@ public static function swaggerFormats()
'value' => 'getValue',
'isRecurring' => 'getIsRecurring',
'enumeration' => 'getEnumeration',
'multiCategoryOptions' => 'getMultiCategoryOptions',
'type' => 'getType'
];

Expand Down Expand Up @@ -179,6 +184,7 @@ public function getModelName()
const TYPE_BOOLEAN = 'boolean';
const TYPE_ID = 'id';
const TYPE_CATEGORY = 'category';
const TYPE_MULTIPLE_CHOICE = 'multiple-choice';



Expand All @@ -196,6 +202,7 @@ public function getTypeAllowableValues()
self::TYPE_BOOLEAN,
self::TYPE_ID,
self::TYPE_CATEGORY,
self::TYPE_MULTIPLE_CHOICE,
];
}

Expand All @@ -218,6 +225,7 @@ public function __construct(array $data = null)
$this->container['value'] = isset($data['value']) ? $data['value'] : null;
$this->container['isRecurring'] = isset($data['isRecurring']) ? $data['isRecurring'] : null;
$this->container['enumeration'] = isset($data['enumeration']) ? $data['enumeration'] : null;
$this->container['multiCategoryOptions'] = isset($data['multiCategoryOptions']) ? $data['multiCategoryOptions'] : null;
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
}

Expand Down Expand Up @@ -325,6 +333,30 @@ public function setEnumeration($enumeration)
return $this;
}

/**
* Gets multiCategoryOptions
*
* @return string[]
*/
public function getMultiCategoryOptions()
{
return $this->container['multiCategoryOptions'];
}

/**
* Sets multiCategoryOptions
*
* @param string[] $multiCategoryOptions List of options you want to add for multiple-choice attribute. **Use only if the attribute's category is \"normal\" and attribute's type is \"multiple-choice\".** For example: **[\"USA\",\"INDIA\"]**
*
* @return $this
*/
public function setMultiCategoryOptions($multiCategoryOptions)
{
$this->container['multiCategoryOptions'] = $multiCategoryOptions;

return $this;
}

/**
* Gets type
*
Expand All @@ -338,7 +370,7 @@ public function getType()
/**
* Sets type
*
* @param string $type Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute )
* @param string $type Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' and 'multiple-choice' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute )
*
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/GetAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Brevo API
*
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity |
*
* OpenAPI spec version: 3.0.0
* Contact: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/GetAttributesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Brevo API
*
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity |
*
* OpenAPI spec version: 3.0.0
* Contact: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/GetAttributesEnumeration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Brevo API
*
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity |
*
* OpenAPI spec version: 3.0.0
* Contact: [email protected]
Expand Down
42 changes: 36 additions & 6 deletions lib/Model/UpdateAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Brevo API
*
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
* Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity |
*
* OpenAPI spec version: 3.0.0
* Contact: [email protected]
Expand Down Expand Up @@ -58,7 +58,8 @@ class UpdateAttribute implements ModelInterface, ArrayAccess
*/
protected static $swaggerTypes = [
'value' => 'string',
'enumeration' => '\Brevo\Client\Model\UpdateAttributeEnumeration[]'
'enumeration' => '\Brevo\Client\Model\UpdateAttributeEnumeration[]',
'multiCategoryOptions' => 'string[]'
];

/**
Expand All @@ -68,7 +69,8 @@ class UpdateAttribute implements ModelInterface, ArrayAccess
*/
protected static $swaggerFormats = [
'value' => null,
'enumeration' => null
'enumeration' => null,
'multiCategoryOptions' => null
];

/**
Expand Down Expand Up @@ -99,7 +101,8 @@ public static function swaggerFormats()
*/
protected static $attributeMap = [
'value' => 'value',
'enumeration' => 'enumeration'
'enumeration' => 'enumeration',
'multiCategoryOptions' => 'multiCategoryOptions'
];

/**
Expand All @@ -109,7 +112,8 @@ public static function swaggerFormats()
*/
protected static $setters = [
'value' => 'setValue',
'enumeration' => 'setEnumeration'
'enumeration' => 'setEnumeration',
'multiCategoryOptions' => 'setMultiCategoryOptions'
];

/**
Expand All @@ -119,7 +123,8 @@ public static function swaggerFormats()
*/
protected static $getters = [
'value' => 'getValue',
'enumeration' => 'getEnumeration'
'enumeration' => 'getEnumeration',
'multiCategoryOptions' => 'getMultiCategoryOptions'
];

/**
Expand Down Expand Up @@ -184,6 +189,7 @@ public function __construct(array $data = null)
{
$this->container['value'] = isset($data['value']) ? $data['value'] : null;
$this->container['enumeration'] = isset($data['enumeration']) ? $data['enumeration'] : null;
$this->container['multiCategoryOptions'] = isset($data['multiCategoryOptions']) ? $data['multiCategoryOptions'] : null;
}

/**
Expand Down Expand Up @@ -257,6 +263,30 @@ public function setEnumeration($enumeration)

return $this;
}

/**
* Gets multiCategoryOptions
*
* @return string[]
*/
public function getMultiCategoryOptions()
{
return $this->container['multiCategoryOptions'];
}

/**
* Sets multiCategoryOptions
*
* @param string[] $multiCategoryOptions Use this option to add multiple-choice attributes options only if the attribute's category is \"normal\". **This option is specifically designed for updating multiple-choice attributes**. For example: **[\"USA\",\"INDIA\"]**
*
* @return $this
*/
public function setMultiCategoryOptions($multiCategoryOptions)
{
$this->container['multiCategoryOptions'] = $multiCategoryOptions;

return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
Expand Down
Loading

0 comments on commit f4741ee

Please sign in to comment.