diff --git a/CHANGELOG.md b/CHANGELOG.md index 083d9ee7..9bda7dab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,92 @@ +### v4.20.0 (2026-05-04) +* * * +### New Resources: +- [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements) has been added. + + +### New Actions: +- [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`retrieve_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/retrieve-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`delete_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/delete-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). + + +### New Attributes: +- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/alert-status-object#alarm_status) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). + + +### New Parameters: +- [`limit`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#limit) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`offset`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#offset) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`status`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#status) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`type`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#type) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`limit`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#limit) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`offset`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#offset) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`id`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#id) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`type`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#type) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`subscription_id`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#subscription_id) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`status`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#status) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`limit`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#limit) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`offset`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#offset) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#alarm_status) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`alert_id`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#alert_id) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`limit`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#limit) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`offset`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#offset) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#alarm_status) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`exclude`](https://apidocs.chargebee.com/docs/api/invoices/list-invoices#exclude) has been added as query parameter to [`list_invoices`](https://apidocs.chargebee.com/docs/api/invoices/list-invoices) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`threshold`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert#threshold) has been added as request body parameter to [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`status`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert#status) has been added as request body parameter to [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`threshold`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#threshold) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`filter_conditions`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#filter_conditions) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`type`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#type) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`name`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#name) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`description`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#description) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`metered_feature_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#metered_feature_id) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`subscription_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#subscription_id) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`meta`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#meta) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`defer_payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent#defer_payment_method_type) has been added as request body parameter to [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`net_term_days`](https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges#net_term_days) has been added as request body parameter to [`edit_quote_for_charge_items_and_charges`](https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`net_term_days`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-charge-and-charge-items#net_term_days) has been added as request body parameter to [`create_a_quote_for_charge_and_charge_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-charge-and-charge-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### Deleted Attributes: +- `alarm_triggered_at` has been removed from [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `scope` has been removed from [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `alert_status` has been removed from [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). + + +### New Enums: +- `within_limit` and `in_alarm` have been added as new values enum `AlarmStatus`. +- `moyasar` and `payway` have been added as new values enum `Gateway`. +- `absolute` and `percentage` have been added as new values enum `Mode`. +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `PaymentMethod`. +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `PaymentMethodType`. +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `Type`. +- `mada` has been added as a new value to enum attribute [`card_type`](https://apidocs.chargebee.com/docs/api/cards/card-object#card_type) in [`Card`](https://apidocs.chargebee.com/docs/api/cards). +- `rate_limited` has been added as a new value to enum attribute [`webhook_status`](https://apidocs.chargebee.com/docs/api/events/event-object#webhook_status) in [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `mada` has been added as a new value to enum attribute [`card.brand`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#card_brand) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- `plan_price`, `addon_price`, `charge_price`, and `charge` have been added as new values to enum attribute [`entity_type`](https://apidocs.chargebee.com/docs/api/quote_entitlements/quote-entitlement-object#entity_type) in [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements). +- `disabled` and `enabled` have been added as new values to enum query parameter `status.is` in [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `enabled` and `disabled` have been added as new values to enum request body parameter `status` in [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `disabled` and `enabled` have been added as new values to enum query parameter `status.is` in [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `plan_price_id` has been added as a new value to enum request body parameter `filter_conditions.field` in [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `not_equals` and `equals` have been added as new values to enum request body parameter `filter_conditions.operator` in [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `rate_limited` has been added as a new value to enum query parameter `webhook_status.is` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `rate_limited` has been added as a new value to enum query parameter `webhook_status.is_not` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `rate_limited` has been added as a new value to enum query parameter `webhook_status.in` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `rate_limited` has been added as a new value to enum query parameter `webhook_status.not_in` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `mada` has been added as a new value to enum request body parameter `card.brand` in [`create_using_permanent_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-permanent-token) of [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + + ### v4.19.0 (2026-03-27) * * * ### New Resources: diff --git a/VERSION b/VERSION index a69aa5a4..bafdf705 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.19.0 +4.20.0 diff --git a/src/Actions/AlertActions.php b/src/Actions/AlertActions.php new file mode 100644 index 00000000..2d9dc0b0 --- /dev/null +++ b/src/Actions/AlertActions.php @@ -0,0 +1,266 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * status?: array{ + * is?: mixed, + * }, + * type?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ApplicationAlertsForSubscriptionAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function applicationAlertsForSubscription(string $id, array $params = [], array $headers = []): ApplicationAlertsForSubscriptionAlertResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["subscriptions",$id,"applicable_alerts"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ApplicationAlertsForSubscriptionAlertResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/retrieve-an-alert?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveAlertResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["alerts",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveAlertResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/update-an-alert?lang=php-v4 + * @param array{ + * threshold?: array{ + * mode?: string, + * value?: float, + * }, + * status?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateAlertResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["alerts",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateAlertResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/delete-an-alert?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeleteAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $headers = []): DeleteAlertResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["alerts",$id,"delete"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeleteAlertResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/list-alerts?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * id?: array{ + * in?: mixed, + * }, + * type?: array{ + * is?: mixed, + * }, + * subscription_id?: array{ + * is?: mixed, + * }, + * status?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListAlertResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["alerts"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListAlertResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/create-an-alert?lang=php-v4 + * @param array{ + * threshold?: array{ + * mode?: string, + * value?: float, + * }, + * filter_conditions?: array, + * type?: string, + * name?: string, + * description?: string, + * metered_feature_id?: string, + * subscription_id?: string, + * meta?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateAlertResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["alerts"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CreateAlertResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/AlertStatusActions.php b/src/Actions/AlertStatusActions.php new file mode 100644 index 00000000..a7554274 --- /dev/null +++ b/src/Actions/AlertStatusActions.php @@ -0,0 +1,106 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * alarm_status?: array{ + * is?: mixed, + * }, + * alert_id?: array{ + * in?: mixed, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return AlertStatusesForSubscriptionAlertStatusResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function alertStatusesForSubscription(string $id, array $params = [], array $headers = []): AlertStatusesForSubscriptionAlertStatusResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["subscriptions",$id,"alert_statuses"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return AlertStatusesForSubscriptionAlertStatusResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * alarm_status?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return AlertStatusesForAlertAlertStatusResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function alertStatusesForAlert(string $id, array $params = [], array $headers = []): AlertStatusesForAlertAlertStatusResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["alerts",$id,"alert_statuses"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return AlertStatusesForAlertAlertStatusResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/AlertActionsInterface.php b/src/Actions/Contracts/AlertActionsInterface.php new file mode 100644 index 00000000..6a0bcc00 --- /dev/null +++ b/src/Actions/Contracts/AlertActionsInterface.php @@ -0,0 +1,150 @@ + $headers + * @return ApplicationAlertsForSubscriptionAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function applicationAlertsForSubscription(string $id, array $params = [], array $headers = []): ApplicationAlertsForSubscriptionAlertResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/retrieve-an-alert?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveAlertResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/update-an-alert?lang=php-v4 + * @param array{ + * threshold?: array{ + * mode?: string, + * value?: float, + * }, + * status?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateAlertResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/delete-an-alert?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeleteAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $headers = []): DeleteAlertResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/list-alerts?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * id?: array{ + * in?: mixed, + * }, + * type?: array{ + * is?: mixed, + * }, + * subscription_id?: array{ + * is?: mixed, + * }, + * status?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListAlertResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/alerts/create-an-alert?lang=php-v4 + * @param array{ + * threshold?: array{ + * mode?: string, + * value?: float, + * }, + * filter_conditions?: array, + * type?: string, + * name?: string, + * description?: string, + * metered_feature_id?: string, + * subscription_id?: string, + * meta?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateAlertResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateAlertResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/AlertStatusActionsInterface.php b/src/Actions/Contracts/AlertStatusActionsInterface.php new file mode 100644 index 00000000..802e774a --- /dev/null +++ b/src/Actions/Contracts/AlertStatusActionsInterface.php @@ -0,0 +1,59 @@ + $headers + * @return AlertStatusesForSubscriptionAlertStatusResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function alertStatusesForSubscription(string $id, array $params = [], array $headers = []): AlertStatusesForSubscriptionAlertStatusResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * alarm_status?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return AlertStatusesForAlertAlertStatusResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function alertStatusesForAlert(string $id, array $params = [], array $headers = []): AlertStatusesForAlertAlertStatusResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/CouponActionsInterface.php b/src/Actions/Contracts/CouponActionsInterface.php index 96c89dbb..79ac6006 100644 --- a/src/Actions/Contracts/CouponActionsInterface.php +++ b/src/Actions/Contracts/CouponActionsInterface.php @@ -86,8 +86,8 @@ * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/EntitlementActionsInterface.php b/src/Actions/Contracts/EntitlementActionsInterface.php index 398ae8ba..a0f27658 100644 --- a/src/Actions/Contracts/EntitlementActionsInterface.php +++ b/src/Actions/Contracts/EntitlementActionsInterface.php @@ -18,16 +18,16 @@ * limit?: int, * offset?: string, * feature_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * entity_type?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * entity_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/Contracts/ExportActionsInterface.php b/src/Actions/Contracts/ExportActionsInterface.php index 4909437e..dcd6b57e 100644 --- a/src/Actions/Contracts/ExportActionsInterface.php +++ b/src/Actions/Contracts/ExportActionsInterface.php @@ -395,8 +395,8 @@ public function differentialPrices(array $params = [], array $headers = []): Dif * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -602,8 +602,8 @@ public function retrieve(string $id, array $headers = []): RetrieveExportRespons * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -693,8 +693,8 @@ public function priceVariants(array $params = [], array $headers = []): PriceVar * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -1602,8 +1602,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * @@ -1862,8 +1862,8 @@ public function orders(array $params = [], array $headers = []): OrdersExportRes * not_in?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/InvoiceActionsInterface.php b/src/Actions/Contracts/InvoiceActionsInterface.php index 5e1f46f7..91bef40f 100644 --- a/src/Actions/Contracts/InvoiceActionsInterface.php +++ b/src/Actions/Contracts/InvoiceActionsInterface.php @@ -452,6 +452,9 @@ public function pauseDunning(string $id, array $params, array $headers = []): Pa * asc?: string, * desc?: string, * }, + * exclude?: array{ + * in?: mixed, + * }, * } $params Description of the parameters * * @param array $headers @@ -1238,13 +1241,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * is?: string, - * in?: string, + * in?: string, + * is?: string, * }, * }, * id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/ItemActionsInterface.php b/src/Actions/Contracts/ItemActionsInterface.php index be97d2d7..f150d119 100644 --- a/src/Actions/Contracts/ItemActionsInterface.php +++ b/src/Actions/Contracts/ItemActionsInterface.php @@ -96,8 +96,8 @@ * not_in?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/ItemFamilyActionsInterface.php b/src/Actions/Contracts/ItemFamilyActionsInterface.php index 281a920c..56bb02c2 100644 --- a/src/Actions/Contracts/ItemFamilyActionsInterface.php +++ b/src/Actions/Contracts/ItemFamilyActionsInterface.php @@ -53,8 +53,8 @@ public function delete(string $id, array $headers = []): DeleteItemFamilyRespons * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/ItemPriceActionsInterface.php b/src/Actions/Contracts/ItemPriceActionsInterface.php index 747fd076..80e86b7d 100644 --- a/src/Actions/Contracts/ItemPriceActionsInterface.php +++ b/src/Actions/Contracts/ItemPriceActionsInterface.php @@ -248,8 +248,8 @@ public function findApplicableItems(string $id, array $params = [], array $heade * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/PaymentIntentActionsInterface.php b/src/Actions/Contracts/PaymentIntentActionsInterface.php index 76c7b916..7cfe1da5 100644 --- a/src/Actions/Contracts/PaymentIntentActionsInterface.php +++ b/src/Actions/Contracts/PaymentIntentActionsInterface.php @@ -57,6 +57,7 @@ public function update(string $id, array $params = [], array $headers = []): Upd * currency_code?: string, * gateway_account_id?: string, * reference_id?: string, + * defer_payment_method_type?: bool, * payment_method_type?: string, * success_url?: string, * failure_url?: string, diff --git a/src/Actions/Contracts/PriceVariantActionsInterface.php b/src/Actions/Contracts/PriceVariantActionsInterface.php index b28c0e11..61a2947f 100644 --- a/src/Actions/Contracts/PriceVariantActionsInterface.php +++ b/src/Actions/Contracts/PriceVariantActionsInterface.php @@ -67,8 +67,8 @@ public function delete(string $id, array $headers = []): DeletePriceVariantRespo * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/QuoteActionsInterface.php b/src/Actions/Contracts/QuoteActionsInterface.php index fe41f710..9c0f3e57 100644 --- a/src/Actions/Contracts/QuoteActionsInterface.php +++ b/src/Actions/Contracts/QuoteActionsInterface.php @@ -845,7 +845,8 @@ public function quoteLineGroupsForQuote(string $id, array $params = [], array $h * currency_code?: string, * coupon?: string, * coupon_ids?: array, - * } $params Description of the parameters + * net_term_days?: int, + * } $params Description of the parameters * @param string $id * @param array $headers * @return EditForChargeItemsAndChargesQuoteResponse @@ -987,7 +988,8 @@ public function pdf(string $id, array $params = [], array $headers = []): PdfQuo * currency_code?: string, * coupon?: string, * coupon_ids?: array, - * } $params Description of the parameters + * net_term_days?: int, + * } $params Description of the parameters * * @param array $headers * @return CreateForChargeItemsAndChargesQuoteResponse diff --git a/src/Actions/Contracts/RampActionsInterface.php b/src/Actions/Contracts/RampActionsInterface.php index c8a18bba..1f9eccce 100644 --- a/src/Actions/Contracts/RampActionsInterface.php +++ b/src/Actions/Contracts/RampActionsInterface.php @@ -110,12 +110,12 @@ public function createForSubscription(string $id, array $params, array $headers * offset?: string, * include_deleted?: bool, * status?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * subscription_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * effective_from?: array{ * after?: mixed, diff --git a/src/Actions/Contracts/VirtualBankAccountActionsInterface.php b/src/Actions/Contracts/VirtualBankAccountActionsInterface.php index 8dbf112e..62b2c9b0 100644 --- a/src/Actions/Contracts/VirtualBankAccountActionsInterface.php +++ b/src/Actions/Contracts/VirtualBankAccountActionsInterface.php @@ -86,6 +86,7 @@ public function all(array $params = [], array $headers = []): ListVirtualBankAcc * @param array{ * customer_id?: string, * email?: string, + * gateway_account_id?: string, * scheme?: string, * } $params Description of the parameters * @@ -132,6 +133,7 @@ public function retrieve(string $id, array $headers = []): RetrieveVirtualBankAc * @param array{ * customer_id?: string, * reference_id?: string, + * gateway_account_id?: string, * scheme?: string, * } $params Description of the parameters * diff --git a/src/Actions/CouponActions.php b/src/Actions/CouponActions.php index bcfab703..9cdfe0ca 100644 --- a/src/Actions/CouponActions.php +++ b/src/Actions/CouponActions.php @@ -99,8 +99,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/EntitlementActions.php b/src/Actions/EntitlementActions.php index ebee27f0..6602900d 100644 --- a/src/Actions/EntitlementActions.php +++ b/src/Actions/EntitlementActions.php @@ -31,16 +31,16 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * feature_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * entity_type?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * entity_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/ExportActions.php b/src/Actions/ExportActions.php index b9035866..beeeaf9b 100644 --- a/src/Actions/ExportActions.php +++ b/src/Actions/ExportActions.php @@ -479,8 +479,8 @@ public function differentialPrices(array $params = [], array $headers = []): Dif * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -738,8 +738,8 @@ public function retrieve(string $id, array $headers = []): RetrieveExportRespons * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -847,8 +847,8 @@ public function priceVariants(array $params = [], array $headers = []): PriceVar * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -1828,8 +1828,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * @@ -2124,8 +2124,8 @@ public function orders(array $params = [], array $headers = []): OrdersExportRes * not_in?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/InvoiceActions.php b/src/Actions/InvoiceActions.php index 19f3a990..781140a8 100644 --- a/src/Actions/InvoiceActions.php +++ b/src/Actions/InvoiceActions.php @@ -696,6 +696,9 @@ public function pauseDunning(string $id, array $params, array $headers = []): Pa * asc?: string, * desc?: string, * }, + * exclude?: array{ + * in?: mixed, + * }, * } $params Description of the parameters * * @param array $headers @@ -1770,13 +1773,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * is?: string, - * in?: string, + * in?: string, + * is?: string, * }, * }, * id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/ItemActions.php b/src/Actions/ItemActions.php index 598d5b0b..ea53bff1 100644 --- a/src/Actions/ItemActions.php +++ b/src/Actions/ItemActions.php @@ -109,8 +109,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * not_in?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/ItemFamilyActions.php b/src/Actions/ItemFamilyActions.php index 95401836..3cd98840 100644 --- a/src/Actions/ItemFamilyActions.php +++ b/src/Actions/ItemFamilyActions.php @@ -83,8 +83,8 @@ public function delete(string $id, array $headers = []): DeleteItemFamilyRespons * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/ItemPriceActions.php b/src/Actions/ItemPriceActions.php index a7e2eb76..fe8b8392 100644 --- a/src/Actions/ItemPriceActions.php +++ b/src/Actions/ItemPriceActions.php @@ -347,8 +347,8 @@ public function findApplicableItems(string $id, array $params = [], array $heade * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/PaymentIntentActions.php b/src/Actions/PaymentIntentActions.php index 8996c1a4..e73efbb0 100644 --- a/src/Actions/PaymentIntentActions.php +++ b/src/Actions/PaymentIntentActions.php @@ -103,6 +103,7 @@ public function update(string $id, array $params = [], array $headers = []): Upd * currency_code?: string, * gateway_account_id?: string, * reference_id?: string, + * defer_payment_method_type?: bool, * payment_method_type?: string, * success_url?: string, * failure_url?: string, diff --git a/src/Actions/PriceVariantActions.php b/src/Actions/PriceVariantActions.php index 1d6b672b..28c6029c 100644 --- a/src/Actions/PriceVariantActions.php +++ b/src/Actions/PriceVariantActions.php @@ -97,8 +97,8 @@ public function delete(string $id, array $headers = []): DeletePriceVariantRespo * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/QuoteActions.php b/src/Actions/QuoteActions.php index 2690fe7f..0f4de861 100644 --- a/src/Actions/QuoteActions.php +++ b/src/Actions/QuoteActions.php @@ -1120,7 +1120,8 @@ public function quoteLineGroupsForQuote(string $id, array $params = [], array $h * currency_code?: string, * coupon?: string, * coupon_ids?: array, - * } $params Description of the parameters + * net_term_days?: int, + * } $params Description of the parameters * @param string $id * @param array $headers * @return EditForChargeItemsAndChargesQuoteResponse @@ -1332,7 +1333,8 @@ public function pdf(string $id, array $params = [], array $headers = []): PdfQuo * currency_code?: string, * coupon?: string, * coupon_ids?: array, - * } $params Description of the parameters + * net_term_days?: int, + * } $params Description of the parameters * * @param array $headers * @return CreateForChargeItemsAndChargesQuoteResponse diff --git a/src/Actions/RampActions.php b/src/Actions/RampActions.php index 1eb86739..9be5910d 100644 --- a/src/Actions/RampActions.php +++ b/src/Actions/RampActions.php @@ -157,12 +157,12 @@ public function createForSubscription(string $id, array $params, array $headers * offset?: string, * include_deleted?: bool, * status?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * subscription_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * effective_from?: array{ * after?: mixed, diff --git a/src/Actions/VirtualBankAccountActions.php b/src/Actions/VirtualBankAccountActions.php index ed213748..bee91700 100644 --- a/src/Actions/VirtualBankAccountActions.php +++ b/src/Actions/VirtualBankAccountActions.php @@ -150,6 +150,7 @@ public function all(array $params = [], array $headers = []): ListVirtualBankAcc * @param array{ * customer_id?: string, * email?: string, + * gateway_account_id?: string, * scheme?: string, * } $params Description of the parameters * @@ -247,6 +248,7 @@ public function retrieve(string $id, array $headers = []): RetrieveVirtualBankAc * @param array{ * customer_id?: string, * reference_id?: string, + * gateway_account_id?: string, * scheme?: string, * } $params Description of the parameters * diff --git a/src/ChargebeeClient.php b/src/ChargebeeClient.php index cdcdf617..62f6b1f6 100644 --- a/src/ChargebeeClient.php +++ b/src/ChargebeeClient.php @@ -4,6 +4,10 @@ use Chargebee\Actions\AddonActions; use Chargebee\Actions\Contracts\AddressActionsInterface; use Chargebee\Actions\AddressActions; +use Chargebee\Actions\Contracts\AlertActionsInterface; +use Chargebee\Actions\AlertActions; +use Chargebee\Actions\Contracts\AlertStatusActionsInterface; +use Chargebee\Actions\AlertStatusActions; use Chargebee\Actions\Contracts\AttachedItemActionsInterface; use Chargebee\Actions\AttachedItemActions; use Chargebee\Actions\Contracts\BusinessEntityActionsInterface; @@ -213,6 +217,14 @@ public function address() :AddressActionsInterface { return new AddressActions($this->httpClientFactory, $this->env); } + public function alert() :AlertActionsInterface { + return new AlertActions($this->httpClientFactory, $this->env); + } + + public function alertStatus() :AlertStatusActionsInterface { + return new AlertStatusActions($this->httpClientFactory, $this->env); + } + public function attachedItem() :AttachedItemActionsInterface { return new AttachedItemActions($this->httpClientFactory, $this->env); } diff --git a/src/Enums/AlarmStatus.php b/src/Enums/AlarmStatus.php new file mode 100644 index 00000000..3a0c61b5 --- /dev/null +++ b/src/Enums/AlarmStatus.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Enums/EntityType.php b/src/Enums/EntityType.php index 751d1539..43b69fbd 100644 --- a/src/Enums/EntityType.php +++ b/src/Enums/EntityType.php @@ -9,6 +9,10 @@ enum EntityType : string { case PLAN_ITEM_PRICE = "plan_item_price"; case ADDON_ITEM_PRICE = "addon_item_price"; case CHARGE_ITEM_PRICE = "charge_item_price"; + case PLAN_PRICE = "plan_price"; + case ADDON_PRICE = "addon_price"; + case CHARGE_PRICE = "charge_price"; + case CHARGE = "charge"; case INVOICE = "invoice"; case QUOTE = "quote"; case CREDIT_NOTE = "credit_note"; @@ -22,9 +26,6 @@ enum EntityType : string { case PLAN_ITEM = "plan_item"; case ADDON_ITEM = "addon_item"; case CHARGE_ITEM = "charge_item"; - case PLAN_PRICE = "plan_price"; - case ADDON_PRICE = "addon_price"; - case CHARGE_PRICE = "charge_price"; case DIFFERENTIAL_PRICE = "differential_price"; case ATTACHED_ITEM = "attached_item"; case FEATURE = "feature"; @@ -44,7 +45,6 @@ enum EntityType : string { case BUSINESS_RULE = "business_rule"; case RULESET = "ruleset"; case ALERT_STATUS = "alert_status"; - case CHARGE = "charge"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Enums/Gateway.php b/src/Enums/Gateway.php index aea94988..39406905 100644 --- a/src/Enums/Gateway.php +++ b/src/Enums/Gateway.php @@ -60,6 +60,8 @@ enum Gateway : string { case EZIDEBIT = "ezidebit"; case TWIKEY = "twikey"; case TEMPUS = "tempus"; + case MOYASAR = "moyasar"; + case PAYWAY = "payway"; case GOCARDLESS = "gocardless"; case NOT_APPLICABLE = "not_applicable"; case UNKNOWN = "unknown"; diff --git a/src/Enums/Mode.php b/src/Enums/Mode.php new file mode 100644 index 00000000..50ca49e1 --- /dev/null +++ b/src/Enums/Mode.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Enums/PaymentMethod.php b/src/Enums/PaymentMethod.php index 433b20fa..52d4dba5 100644 --- a/src/Enums/PaymentMethod.php +++ b/src/Enums/PaymentMethod.php @@ -46,6 +46,13 @@ enum PaymentMethod : string { case REVOLUT_PAY = "revolut_pay"; case CASH_APP_PAY = "cash_app_pay"; case PIX = "pix"; + case TWINT = "twint"; + case GO_PAY = "go_pay"; + case GRAB_PAY = "grab_pay"; + case PAY_CO = "pay_co"; + case AFTER_PAY = "after_pay"; + case SWISH = "swish"; + case PAYME = "payme"; /* * @depcreated */ diff --git a/src/Enums/PaymentMethodType.php b/src/Enums/PaymentMethodType.php index 8ce18b01..3f3ce7a6 100644 --- a/src/Enums/PaymentMethodType.php +++ b/src/Enums/PaymentMethodType.php @@ -38,6 +38,13 @@ enum PaymentMethodType : string { case REVOLUT_PAY = "revolut_pay"; case CASH_APP_PAY = "cash_app_pay"; case PIX = "pix"; + case TWINT = "twint"; + case GO_PAY = "go_pay"; + case GRAB_PAY = "grab_pay"; + case PAY_CO = "pay_co"; + case AFTER_PAY = "after_pay"; + case SWISH = "swish"; + case PAYME = "payme"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Enums/Type.php b/src/Enums/Type.php index 9e37802a..dddb0a53 100644 --- a/src/Enums/Type.php +++ b/src/Enums/Type.php @@ -38,6 +38,13 @@ enum Type : string { case REVOLUT_PAY = "revolut_pay"; case CASH_APP_PAY = "cash_app_pay"; case PIX = "pix"; + case TWINT = "twint"; + case GO_PAY = "go_pay"; + case GRAB_PAY = "grab_pay"; + case PAY_CO = "pay_co"; + case AFTER_PAY = "after_pay"; + case SWISH = "swish"; + case PAYME = "payme"; case FREE_TRIAL = "free_trial"; case PAY_UP_FRONT = "pay_up_front"; case PAY_AS_YOU_GO = "pay_as_you_go"; diff --git a/src/Resources/Alert/Alert.php b/src/Resources/Alert/Alert.php index cec5ddaa..336cb848 100644 --- a/src/Resources/Alert/Alert.php +++ b/src/Resources/Alert/Alert.php @@ -33,12 +33,6 @@ class Alert { */ public ?string $subscription_id; - /** - * - * @var ?int $alarm_triggered_at - */ - public ?int $alarm_triggered_at; - /** * * @var ?string $meta @@ -69,16 +63,10 @@ class Alert { */ public ?\Chargebee\Resources\Alert\Enums\Status $status; - /** - * - * @var ?\Chargebee\Resources\Alert\Enums\Scope $scope - */ - public ?\Chargebee\Resources\Alert\Enums\Scope $scope; - /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "name" , "description" , "metered_feature_id" , "subscription_id" , "alarm_triggered_at" , "meta" , "created_at" , "updated_at" ]; + protected static array $knownFields = [ "id" , "name" , "description" , "metered_feature_id" , "subscription_id" , "meta" , "created_at" , "updated_at" ]; /** * dynamic properties for resources @@ -92,13 +80,11 @@ private function __construct( ?string $description, ?string $metered_feature_id, ?string $subscription_id, - ?int $alarm_triggered_at, ?string $meta, ?int $created_at, ?int $updated_at, ?\Chargebee\Enums\Type $type, ?\Chargebee\Resources\Alert\Enums\Status $status, - ?\Chargebee\Resources\Alert\Enums\Scope $scope, ) { $this->id = $id; @@ -106,13 +92,11 @@ private function __construct( $this->description = $description; $this->metered_feature_id = $metered_feature_id; $this->subscription_id = $subscription_id; - $this->alarm_triggered_at = $alarm_triggered_at; $this->meta = $meta; $this->created_at = $created_at; $this->updated_at = $updated_at; $this->type = $type; - $this->status = $status; - $this->scope = $scope; + $this->status = $status; } public static function from(array $resourceAttributes): self @@ -122,7 +106,6 @@ public static function from(array $resourceAttributes): self $resourceAttributes['description'] ?? null, $resourceAttributes['metered_feature_id'] ?? null, $resourceAttributes['subscription_id'] ?? null, - $resourceAttributes['alarm_triggered_at'] ?? null, $resourceAttributes['meta'] ?? null, $resourceAttributes['created_at'] ?? null, $resourceAttributes['updated_at'] ?? null, @@ -131,8 +114,6 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['type']) ? \Chargebee\Enums\Type::tryFromValue($resourceAttributes['type']) : null, isset($resourceAttributes['status']) ? \Chargebee\Resources\Alert\Enums\Status::tryFromValue($resourceAttributes['status']) : null, - - isset($resourceAttributes['scope']) ? \Chargebee\Resources\Alert\Enums\Scope::tryFromValue($resourceAttributes['scope']) : null, ); @@ -147,7 +128,6 @@ public function toArray(): array 'description' => $this->description, 'metered_feature_id' => $this->metered_feature_id, 'subscription_id' => $this->subscription_id, - 'alarm_triggered_at' => $this->alarm_triggered_at, 'meta' => $this->meta, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, @@ -156,8 +136,6 @@ public function toArray(): array 'status' => $this->status?->value, - 'scope' => $this->scope?->value, - ], function ($value) { return $value !== null; }); diff --git a/src/Resources/AlertStatus/AlertStatus.php b/src/Resources/AlertStatus/AlertStatus.php index ce051407..35c1f954 100644 --- a/src/Resources/AlertStatus/AlertStatus.php +++ b/src/Resources/AlertStatus/AlertStatus.php @@ -23,9 +23,9 @@ class AlertStatus { /** * - * @var ?\Chargebee\Enums\AlertStatus $alert_status + * @var ?\Chargebee\Enums\AlarmStatus $alarm_status */ - public ?\Chargebee\Enums\AlertStatus $alert_status; + public ?\Chargebee\Enums\AlarmStatus $alarm_status; /** * @var array $knownFields @@ -42,13 +42,13 @@ private function __construct( ?string $alert_id, ?string $subscription_id, ?int $alarm_triggered_at, - ?\Chargebee\Enums\AlertStatus $alert_status, + ?\Chargebee\Enums\AlarmStatus $alarm_status, ) { $this->alert_id = $alert_id; $this->subscription_id = $subscription_id; $this->alarm_triggered_at = $alarm_triggered_at; - $this->alert_status = $alert_status; + $this->alarm_status = $alarm_status; } public static function from(array $resourceAttributes): self @@ -58,7 +58,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['alarm_triggered_at'] ?? null, - isset($resourceAttributes['alert_status']) ? \Chargebee\Enums\AlertStatus::tryFromValue($resourceAttributes['alert_status']) : null, + isset($resourceAttributes['alarm_status']) ? \Chargebee\Enums\AlarmStatus::tryFromValue($resourceAttributes['alarm_status']) : null, ); @@ -72,7 +72,7 @@ public function toArray(): array 'subscription_id' => $this->subscription_id, 'alarm_triggered_at' => $this->alarm_triggered_at, - 'alert_status' => $this->alert_status?->value, + 'alarm_status' => $this->alarm_status?->value, ], function ($value) { return $value !== null; diff --git a/src/Resources/Card/Enums/CardType.php b/src/Resources/Card/Enums/CardType.php index b763e5e0..af7c94b2 100644 --- a/src/Resources/Card/Enums/CardType.php +++ b/src/Resources/Card/Enums/CardType.php @@ -23,6 +23,7 @@ enum CardType : string { case MAESTRO = "maestro"; case DANKORT = "dankort"; case CARTES_BANCAIRES = "cartes_bancaires"; + case MADA = "mada"; case OTHER = "other"; case NOT_APPLICABLE = "not_applicable"; case UNKNOWN = "unknown"; diff --git a/src/Resources/Content/Content.php b/src/Resources/Content/Content.php index 992bfac0..12583da0 100644 --- a/src/Resources/Content/Content.php +++ b/src/Resources/Content/Content.php @@ -36,6 +36,7 @@ use Chargebee\Resources\Event\Event; use Chargebee\Resources\Export\Export; use Chargebee\Resources\Feature\Feature; +use Chargebee\Resources\FilterCondition\FilterCondition; use Chargebee\Resources\GatewayErrorDetail\GatewayErrorDetail; use Chargebee\Resources\Gift\Gift; use Chargebee\Resources\Hierarchy\Hierarchy; @@ -78,6 +79,7 @@ use Chargebee\Resources\PromotionalCredit\PromotionalCredit; use Chargebee\Resources\Purchase\Purchase; use Chargebee\Resources\Quote\Quote; +use Chargebee\Resources\QuoteEntitlement\QuoteEntitlement; use Chargebee\Resources\QuoteLineGroup\QuoteLineGroup; use Chargebee\Resources\QuotedCharge\QuotedCharge; use Chargebee\Resources\QuotedDeltaRamp\QuotedDeltaRamp; @@ -318,6 +320,12 @@ class Content { */ public ?Feature $feature; + /** + * + * @var ?FilterCondition $filtercondition + */ + public ?FilterCondition $filtercondition; + /** * * @var ?GatewayErrorDetail $gatewayerrordetail @@ -570,6 +578,12 @@ class Content { */ public ?Quote $quote; + /** + * + * @var ?QuoteEntitlement $quoteentitlement + */ + public ?QuoteEntitlement $quoteentitlement; + /** * * @var ?QuoteLineGroup $quotelinegroup @@ -741,7 +755,7 @@ class Content { /** * @var array $knownFields */ - protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "gateway_error_detail" , "gift" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "metadata" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "purchase" , "quote" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "virtual_bank_account" , "webhook_endpoint" ]; + protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gift" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "metadata" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "purchase" , "quote" , "quote_entitlement" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "virtual_bank_account" , "webhook_endpoint" ]; /** * dynamic properties for resources @@ -785,6 +799,7 @@ private function __construct( ?Event $event, ?Export $export, ?Feature $feature, + ?FilterCondition $filtercondition, ?GatewayErrorDetail $gatewayerrordetail, ?Gift $gift, ?Hierarchy $hierarchy, @@ -827,6 +842,7 @@ private function __construct( ?PromotionalCredit $promotionalcredit, ?Purchase $purchase, ?Quote $quote, + ?QuoteEntitlement $quoteentitlement, ?QuoteLineGroup $quotelinegroup, ?QuotedCharge $quotedcharge, ?QuotedDeltaRamp $quoteddeltaramp, @@ -892,6 +908,7 @@ private function __construct( $this->event = $event; $this->export = $export; $this->feature = $feature; + $this->filtercondition = $filtercondition; $this->gatewayerrordetail = $gatewayerrordetail; $this->gift = $gift; $this->hierarchy = $hierarchy; @@ -934,6 +951,7 @@ private function __construct( $this->promotionalcredit = $promotionalcredit; $this->purchase = $purchase; $this->quote = $quote; + $this->quoteentitlement = $quoteentitlement; $this->quotelinegroup = $quotelinegroup; $this->quotedcharge = $quotedcharge; $this->quoteddeltaramp = $quoteddeltaramp; @@ -1001,6 +1019,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['event']) ? Event::from($resourceAttributes['event']) : null, isset($resourceAttributes['export']) ? Export::from($resourceAttributes['export']) : null, isset($resourceAttributes['feature']) ? Feature::from($resourceAttributes['feature']) : null, + isset($resourceAttributes['filter_condition']) ? FilterCondition::from($resourceAttributes['filter_condition']) : null, isset($resourceAttributes['gateway_error_detail']) ? GatewayErrorDetail::from($resourceAttributes['gateway_error_detail']) : null, isset($resourceAttributes['gift']) ? Gift::from($resourceAttributes['gift']) : null, isset($resourceAttributes['hierarchy']) ? Hierarchy::from($resourceAttributes['hierarchy']) : null, @@ -1043,6 +1062,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['promotional_credit']) ? PromotionalCredit::from($resourceAttributes['promotional_credit']) : null, isset($resourceAttributes['purchase']) ? Purchase::from($resourceAttributes['purchase']) : null, isset($resourceAttributes['quote']) ? Quote::from($resourceAttributes['quote']) : null, + isset($resourceAttributes['quote_entitlement']) ? QuoteEntitlement::from($resourceAttributes['quote_entitlement']) : null, isset($resourceAttributes['quote_line_group']) ? QuoteLineGroup::from($resourceAttributes['quote_line_group']) : null, isset($resourceAttributes['quoted_charge']) ? QuotedCharge::from($resourceAttributes['quoted_charge']) : null, isset($resourceAttributes['quoted_delta_ramp']) ? QuotedDeltaRamp::from($resourceAttributes['quoted_delta_ramp']) : null, @@ -1184,6 +1204,8 @@ public function toArray(): array + + @@ -1297,6 +1319,9 @@ public function toArray(): array if($this->feature instanceof Feature){ $data['feature'] = $this->feature->toArray(); } + if($this->filtercondition instanceof FilterCondition){ + $data['filter_condition'] = $this->filtercondition->toArray(); + } if($this->gatewayerrordetail instanceof GatewayErrorDetail){ $data['gateway_error_detail'] = $this->gatewayerrordetail->toArray(); } @@ -1423,6 +1448,9 @@ public function toArray(): array if($this->quote instanceof Quote){ $data['quote'] = $this->quote->toArray(); } + if($this->quoteentitlement instanceof QuoteEntitlement){ + $data['quote_entitlement'] = $this->quoteentitlement->toArray(); + } if($this->quotelinegroup instanceof QuoteLineGroup){ $data['quote_line_group'] = $this->quotelinegroup->toArray(); } diff --git a/src/Resources/Event/Enums/WebhookStatus.php b/src/Resources/Event/Enums/WebhookStatus.php index a85d6a36..abd7d044 100644 --- a/src/Resources/Event/Enums/WebhookStatus.php +++ b/src/Resources/Event/Enums/WebhookStatus.php @@ -11,6 +11,7 @@ enum WebhookStatus : string { case SKIPPED = "skipped"; case NOT_APPLICABLE = "not_applicable"; case DISABLED = "disabled"; + case RATE_LIMITED = "rate_limited"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/Event/Enums/WebhookWebhookStatus.php b/src/Resources/Event/Enums/WebhookWebhookStatus.php index 341299d1..b29ea3d7 100644 --- a/src/Resources/Event/Enums/WebhookWebhookStatus.php +++ b/src/Resources/Event/Enums/WebhookWebhookStatus.php @@ -11,6 +11,7 @@ enum WebhookWebhookStatus : string { case SKIPPED = "skipped"; case NOT_APPLICABLE = "not_applicable"; case DISABLED = "disabled"; + case RATE_LIMITED = "rate_limited"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/FilterCondition/Enums/Field.php b/src/Resources/FilterCondition/Enums/Field.php new file mode 100644 index 00000000..fe0de175 --- /dev/null +++ b/src/Resources/FilterCondition/Enums/Field.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/src/Resources/FilterCondition/Enums/Operator.php b/src/Resources/FilterCondition/Enums/Operator.php new file mode 100644 index 00000000..d809ab04 --- /dev/null +++ b/src/Resources/FilterCondition/Enums/Operator.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/FilterCondition/FilterCondition.php b/src/Resources/FilterCondition/FilterCondition.php new file mode 100644 index 00000000..ddff3eae --- /dev/null +++ b/src/Resources/FilterCondition/FilterCondition.php @@ -0,0 +1,80 @@ + $knownFields + */ + protected static array $knownFields = [ "value" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $value, + ?\Chargebee\Resources\FilterCondition\Enums\Field $field, + ?\Chargebee\Resources\FilterCondition\Enums\Operator $operator, + ) + { + $this->value = $value; + $this->field = $field; + $this->operator = $operator; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['value'] ?? null, + + + isset($resourceAttributes['field']) ? \Chargebee\Resources\FilterCondition\Enums\Field::tryFromValue($resourceAttributes['field']) : null, + + isset($resourceAttributes['operator']) ? \Chargebee\Resources\FilterCondition\Enums\Operator::tryFromValue($resourceAttributes['operator']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['value' => $this->value, + + 'field' => $this->field?->value, + + 'operator' => $this->operator?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PaymentIntent/Enums/PaymentMethodType.php b/src/Resources/PaymentIntent/Enums/PaymentMethodType.php index 5ccc6945..6410fac7 100644 --- a/src/Resources/PaymentIntent/Enums/PaymentMethodType.php +++ b/src/Resources/PaymentIntent/Enums/PaymentMethodType.php @@ -36,6 +36,13 @@ enum PaymentMethodType : string { case WECHAT_PAY = "wechat_pay"; case ALIPAY = "alipay"; case PIX = "pix"; + case TWINT = "twint"; + case GO_PAY = "go_pay"; + case GRAB_PAY = "grab_pay"; + case PAY_CO = "pay_co"; + case AFTER_PAY = "after_pay"; + case SWISH = "swish"; + case PAYME = "payme"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/PaymentSource/Enums/CardBrand.php b/src/Resources/PaymentSource/Enums/CardBrand.php index bf1c62cd..8c1cb73b 100644 --- a/src/Resources/PaymentSource/Enums/CardBrand.php +++ b/src/Resources/PaymentSource/Enums/CardBrand.php @@ -24,6 +24,7 @@ enum CardBrand : string { case MAESTRO = "maestro"; case DANKORT = "dankort"; case CARTES_BANCAIRES = "cartes_bancaires"; + case MADA = "mada"; case NOT_APPLICABLE = "not_applicable"; case UNKNOWN = "unknown"; diff --git a/src/Resources/QuoteEntitlement/Enums/EntityType.php b/src/Resources/QuoteEntitlement/Enums/EntityType.php new file mode 100644 index 00000000..ec4084c9 --- /dev/null +++ b/src/Resources/QuoteEntitlement/Enums/EntityType.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/src/Resources/QuoteEntitlement/QuoteEntitlement.php b/src/Resources/QuoteEntitlement/QuoteEntitlement.php new file mode 100644 index 00000000..491c43d3 --- /dev/null +++ b/src/Resources/QuoteEntitlement/QuoteEntitlement.php @@ -0,0 +1,138 @@ + $knownFields + */ + protected static array $knownFields = [ "entity_id" , "feature_id" , "value" , "is_enabled" , "start_date" , "end_date" , "created_at" , "modified_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $entity_id, + ?string $feature_id, + ?string $value, + ?bool $is_enabled, + ?int $start_date, + ?int $end_date, + ?int $created_at, + ?int $modified_at, + ?\Chargebee\Resources\QuoteEntitlement\Enums\EntityType $entity_type, + ) + { + $this->entity_id = $entity_id; + $this->feature_id = $feature_id; + $this->value = $value; + $this->is_enabled = $is_enabled; + $this->start_date = $start_date; + $this->end_date = $end_date; + $this->created_at = $created_at; + $this->modified_at = $modified_at; + $this->entity_type = $entity_type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['entity_id'] ?? null, + $resourceAttributes['feature_id'] ?? null, + $resourceAttributes['value'] ?? null, + $resourceAttributes['is_enabled'] ?? null, + $resourceAttributes['start_date'] ?? null, + $resourceAttributes['end_date'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['modified_at'] ?? null, + + + isset($resourceAttributes['entity_type']) ? \Chargebee\Resources\QuoteEntitlement\Enums\EntityType::tryFromValue($resourceAttributes['entity_type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['entity_id' => $this->entity_id, + 'feature_id' => $this->feature_id, + 'value' => $this->value, + 'is_enabled' => $this->is_enabled, + 'start_date' => $this->start_date, + 'end_date' => $this->end_date, + 'created_at' => $this->created_at, + 'modified_at' => $this->modified_at, + + 'entity_type' => $this->entity_type?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertResponse/ApplicationAlertsForSubscriptionAlertResponse.php b/src/Responses/AlertResponse/ApplicationAlertsForSubscriptionAlertResponse.php new file mode 100644 index 00000000..a270354b --- /dev/null +++ b/src/Responses/AlertResponse/ApplicationAlertsForSubscriptionAlertResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ApplicationAlertsForSubscriptionAlertResponseListObject { + return new ApplicationAlertsForSubscriptionAlertResponseListObject( + isset($result['alert']) ? Alert::from($result['alert']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertResponse/ApplicationAlertsForSubscriptionAlertResponseListObject.php b/src/Responses/AlertResponse/ApplicationAlertsForSubscriptionAlertResponseListObject.php new file mode 100644 index 00000000..02b0f93e --- /dev/null +++ b/src/Responses/AlertResponse/ApplicationAlertsForSubscriptionAlertResponseListObject.php @@ -0,0 +1,14 @@ +alert = $alert; + } +} diff --git a/src/Responses/AlertResponse/CreateAlertResponse.php b/src/Responses/AlertResponse/CreateAlertResponse.php new file mode 100644 index 00000000..c8778009 --- /dev/null +++ b/src/Responses/AlertResponse/CreateAlertResponse.php @@ -0,0 +1,45 @@ +alert = $alert; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['alert']) ? Alert::from($resourceAttributes['alert']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->alert instanceof Alert){ + $data['alert'] = $this->alert->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertResponse/DeleteAlertResponse.php b/src/Responses/AlertResponse/DeleteAlertResponse.php new file mode 100644 index 00000000..80bb62e4 --- /dev/null +++ b/src/Responses/AlertResponse/DeleteAlertResponse.php @@ -0,0 +1,45 @@ +alert = $alert; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['alert']) ? Alert::from($resourceAttributes['alert']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->alert instanceof Alert){ + $data['alert'] = $this->alert->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertResponse/ListAlertResponse.php b/src/Responses/AlertResponse/ListAlertResponse.php new file mode 100644 index 00000000..ff966a42 --- /dev/null +++ b/src/Responses/AlertResponse/ListAlertResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListAlertResponseListObject { + return new ListAlertResponseListObject( + isset($result['alert']) ? Alert::from($result['alert']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertResponse/ListAlertResponseListObject.php b/src/Responses/AlertResponse/ListAlertResponseListObject.php new file mode 100644 index 00000000..b55df573 --- /dev/null +++ b/src/Responses/AlertResponse/ListAlertResponseListObject.php @@ -0,0 +1,14 @@ +alert = $alert; + } +} diff --git a/src/Responses/AlertResponse/RetrieveAlertResponse.php b/src/Responses/AlertResponse/RetrieveAlertResponse.php new file mode 100644 index 00000000..c7a4ba99 --- /dev/null +++ b/src/Responses/AlertResponse/RetrieveAlertResponse.php @@ -0,0 +1,45 @@ +alert = $alert; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['alert']) ? Alert::from($resourceAttributes['alert']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->alert instanceof Alert){ + $data['alert'] = $this->alert->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertResponse/UpdateAlertResponse.php b/src/Responses/AlertResponse/UpdateAlertResponse.php new file mode 100644 index 00000000..a8faa864 --- /dev/null +++ b/src/Responses/AlertResponse/UpdateAlertResponse.php @@ -0,0 +1,45 @@ +alert = $alert; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['alert']) ? Alert::from($resourceAttributes['alert']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->alert instanceof Alert){ + $data['alert'] = $this->alert->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertStatusResponse/AlertStatusesForAlertAlertStatusResponse.php b/src/Responses/AlertStatusResponse/AlertStatusesForAlertAlertStatusResponse.php new file mode 100644 index 00000000..c2dbd47c --- /dev/null +++ b/src/Responses/AlertStatusResponse/AlertStatusesForAlertAlertStatusResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): AlertStatusesForAlertAlertStatusResponseListObject { + return new AlertStatusesForAlertAlertStatusResponseListObject( + isset($result['alert_status']) ? AlertStatus::from($result['alert_status']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertStatusResponse/AlertStatusesForAlertAlertStatusResponseListObject.php b/src/Responses/AlertStatusResponse/AlertStatusesForAlertAlertStatusResponseListObject.php new file mode 100644 index 00000000..8bf4a3df --- /dev/null +++ b/src/Responses/AlertStatusResponse/AlertStatusesForAlertAlertStatusResponseListObject.php @@ -0,0 +1,14 @@ +alert_status = $alert_status; + } +} diff --git a/src/Responses/AlertStatusResponse/AlertStatusesForSubscriptionAlertStatusResponse.php b/src/Responses/AlertStatusResponse/AlertStatusesForSubscriptionAlertStatusResponse.php new file mode 100644 index 00000000..ee19426f --- /dev/null +++ b/src/Responses/AlertStatusResponse/AlertStatusesForSubscriptionAlertStatusResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): AlertStatusesForSubscriptionAlertStatusResponseListObject { + return new AlertStatusesForSubscriptionAlertStatusResponseListObject( + isset($result['alert_status']) ? AlertStatus::from($result['alert_status']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/AlertStatusResponse/AlertStatusesForSubscriptionAlertStatusResponseListObject.php b/src/Responses/AlertStatusResponse/AlertStatusesForSubscriptionAlertStatusResponseListObject.php new file mode 100644 index 00000000..071d06e3 --- /dev/null +++ b/src/Responses/AlertStatusResponse/AlertStatusesForSubscriptionAlertStatusResponseListObject.php @@ -0,0 +1,14 @@ +alert_status = $alert_status; + } +} diff --git a/src/Version.php b/src/Version.php index fa4fd2d2..1b43c3c5 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '4.19.0'; + const VERSION = '4.20.0'; } ?> \ No newline at end of file