Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DE-799] Add missing nullable types #48

Merged
merged 3 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"php": "^7.2 || ^8.0",
"ext-json": "*",
"apimatic/unirest-php": "^4.0.0",
"apimatic/core-interfaces": "~0.1.0",
"apimatic/core": "~0.3.0"
"apimatic/core-interfaces": "~0.1.4",
"apimatic/core": "~0.3.8"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
Expand Down
396 changes: 228 additions & 168 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/controllers/advance-invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $advanceInvoiceController = $client->getAdvanceInvoiceController();

# Issue Advance Invoice

Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](../../doc/models/invoice.md) for more information on advance invoices, including eligibility on generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided.
Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404811062541-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility on generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided.
A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error.
That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated.
We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it.
Expand Down
13 changes: 13 additions & 0 deletions doc/controllers/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,19 @@ $result = $invoicesController->listInvoices($collect);

Use this endpoint to retrieve the details for an invoice.

## PDF Invoice retrieval

Individual PDF Invoices can be retrieved by using the "Accept" header application/pdf or appending .pdf as the format portion of the URL:

```curl -u <api_key>:x -H
Accept:application/pdf -H
https://acme.chargify.com/invoices/inv_8gd8tdhtd3hgr.pdf > output_file.pdf
URL: `https://<subdomain>.chargify.com/invoices/<uid>.<format>`
Method: GET
Required parameters: `uid`
Response: A single Invoice.
```

```php
function readInvoice(string $uid): Invoice
```
Expand Down
9 changes: 6 additions & 3 deletions doc/controllers/subscription-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function listSubscriptionComponents(array $options): array
| `sort` | [`?string(ListSubscriptionComponentsSort)`](../../doc/models/list-subscription-components-sort.md) | Query, Optional | The attribute by which to sort. Use in query `sort=updated_at`. |
| `startDate` | `?string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. |
| `startDatetime` | `?string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. |
| `mInclude` | [`?string(ListSubscriptionComponentsInclude)`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription`. |
| `mInclude` | [`?(string(ListSubscriptionComponentsInclude)[])`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription,historic_usages`. |

## Response Type

Expand All @@ -141,7 +141,10 @@ $collect = [
3
],
'sort' => ListSubscriptionComponentsSort::UPDATED_AT,
'include' => ListSubscriptionComponentsInclude::SUBSCRIPTION
'include' => [
ListSubscriptionComponentsInclude::SUBSCRIPTION,
ListSubscriptionComponentsInclude::HISTORIC_USAGES
]
];

$result = $subscriptionComponentsController->listSubscriptionComponents($collect);
Expand Down Expand Up @@ -1464,7 +1467,7 @@ function listSubscriptionComponentsForSite(array $options): ListSubscriptionComp
| `subscriptionIds` | `?(int[])` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`. |
| `pricePointIds` | [`?string(IncludeNotNull)`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`. |
| `productFamilyIds` | `?(int[])` | Query, Optional | Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`. |
| `mInclude` | [`?string(ListSubscriptionComponentsInclude)`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription`. |
| `mInclude` | [`?string(ListSubscriptionComponentsInclude)`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription,historic_usages`. |

## Response Type

Expand Down
14 changes: 8 additions & 6 deletions doc/controllers/subscription-group-invoice-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ $uid = 'uid0';

$body = IssueServiceCreditRequestBuilder::init(
IssueServiceCreditBuilder::init(
10,
'Credit the group account'
)->build()
10
)
->memo('Credit the group account')
->build()
)->build();

$result = $subscriptionGroupInvoiceAccountController->issueSubscriptionGroupServiceCredit(
Expand Down Expand Up @@ -222,9 +223,10 @@ $uid = 'uid0';

$body = DeductServiceCreditRequestBuilder::init(
DeductServiceCreditBuilder::init(
10,
'Deduct from group account'
)->build()
10
)
->memo('Deduct from group account')
->build()
)->build();

$result = $subscriptionGroupInvoiceAccountController->deductSubscriptionGroupServiceCredit(
Expand Down
26 changes: 16 additions & 10 deletions doc/controllers/subscription-invoice-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ $subscriptionId = 222;

$body = IssueServiceCreditRequestBuilder::init(
IssueServiceCreditBuilder::init(
'1',
'Courtesy credit'
'1'
)->build()
)->build();

Expand All @@ -228,6 +227,12 @@ $result = $subscriptionInvoiceAccountController->issueServiceCredit(
}
```

## Errors

| HTTP Status Code | Error Description | Exception Class |
| --- | --- | --- |
| 422 | Unprocessable Entity (WebDAV) | `ApiException` |


# Deduct Service Credit

Expand Down Expand Up @@ -255,9 +260,10 @@ $subscriptionId = 222;

$body = DeductServiceCreditRequestBuilder::init(
DeductServiceCreditBuilder::init(
'1',
'Deduction'
)->build()
'1'
)
->memo('Deduction')
->build()
)->build();

$subscriptionInvoiceAccountController->deductServiceCredit(
Expand All @@ -270,7 +276,7 @@ $subscriptionInvoiceAccountController->deductServiceCredit(

| HTTP Status Code | Error Description | Exception Class |
| --- | --- | --- |
| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) |
| 422 | Unprocessable Entity (WebDAV) | `ApiException` |


# Refund Prepayment
Expand All @@ -282,7 +288,7 @@ The amount may be passed either as a decimal, with `amount`, or an integer in ce
```php
function refundPrepayment(
int $subscriptionId,
string $prepaymentId,
int $prepaymentId,
?RefundPrepaymentRequest $body = null
): PrepaymentResponse
```
Expand All @@ -292,7 +298,7 @@ function refundPrepayment(
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription |
| `prepaymentId` | `string` | Template, Required | id of prepayment |
| `prepaymentId` | `int` | Template, Required | id of prepayment |
| `body` | [`?RefundPrepaymentRequest`](../../doc/models/refund-prepayment-request.md) | Body, Optional | - |

## Response Type
Expand All @@ -304,7 +310,7 @@ function refundPrepayment(
```php
$subscriptionId = 222;

$prepaymentId = 'prepayment_id8';
$prepaymentId = 228;

$result = $subscriptionInvoiceAccountController->refundPrepayment(
$subscriptionId,
Expand All @@ -318,5 +324,5 @@ $result = $subscriptionInvoiceAccountController->refundPrepayment(
| --- | --- | --- |
| 400 | Bad Request | [`RefundPrepaymentBaseErrorsResponseException`](../../doc/models/refund-prepayment-base-errors-response-exception.md) |
| 404 | Not Found | `ApiException` |
| 422 | Unprocessable Entity | [`RefundPrepaymentAggregatedErrorsResponseException`](../../doc/models/refund-prepayment-aggregated-errors-response-exception.md) |
| 422 | Unprocessable Entity | `ApiException` |

13 changes: 0 additions & 13 deletions doc/models/containers/coupon-compounding-strategy.md

This file was deleted.

13 changes: 0 additions & 13 deletions doc/models/containers/subscription-component-price-point-type.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/models/coupon.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
| `archivedAt` | `?DateTime` | Optional | - | getArchivedAt(): ?\DateTime | setArchivedAt(?\DateTime archivedAt): void |
| `conversionLimit` | `?string` | Optional | - | getConversionLimit(): ?string | setConversionLimit(?string conversionLimit): void |
| `stackable` | `?bool` | Optional | - | getStackable(): ?bool | setStackable(?bool stackable): void |
| `compoundingStrategy` | string([CompoundingStrategy](../../doc/models/compounding-strategy.md))\|null | Optional | This is a container for any-of cases. | getCompoundingStrategy(): ?string | setCompoundingStrategy(?string compoundingStrategy): void |
| `compoundingStrategy` | [`?string(CompoundingStrategy)`](../../doc/models/compounding-strategy.md) | Optional | - | getCompoundingStrategy(): ?string | setCompoundingStrategy(?string compoundingStrategy): void |
| `useSiteExchangeRate` | `?bool` | Optional | - | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void |
| `createdAt` | `?DateTime` | Optional | - | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void |
| `updatedAt` | `?DateTime` | Optional | - | getUpdatedAt(): ?\DateTime | setUpdatedAt(?\DateTime updatedAt): void |
Expand Down
2 changes: 2 additions & 0 deletions doc/models/create-offer-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `componentId` | `?int` | Optional | - | getComponentId(): ?int | setComponentId(?int componentId): void |
| `pricePointId` | `?int` | Optional | - | getPricePointId(): ?int | setPricePointId(?int pricePointId): void |
| `startingQuantity` | `?int` | Optional | - | getStartingQuantity(): ?int | setStartingQuantity(?int startingQuantity): void |

## Example (as JSON)

```json
{
"component_id": 242,
"price_point_id": 10,
"starting_quantity": 50
}
```
Expand Down
2 changes: 2 additions & 0 deletions doc/models/create-offer-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
"components": [
{
"component_id": 108,
"price_point_id": 124,
"starting_quantity": 84
},
{
"component_id": 108,
"price_point_id": 124,
"starting_quantity": 84
}
],
Expand Down
2 changes: 2 additions & 0 deletions doc/models/create-offer.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
"components": [
{
"component_id": 108,
"price_point_id": 124,
"starting_quantity": 84
},
{
"component_id": 108,
"price_point_id": 124,
"starting_quantity": 84
}
],
Expand Down
2 changes: 1 addition & 1 deletion doc/models/deduct-service-credit.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `amount` | string\|float | Required | This is a container for one-of cases. | getAmount(): | setAmount( amount): void |
| `memo` | `string` | Required | - | getMemo(): string | setMemo(string memo): void |
| `memo` | `?string` | Optional | - | getMemo(): ?string | setMemo(?string memo): void |

## Example (as JSON)

Expand Down
27 changes: 27 additions & 0 deletions doc/models/historic-usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# Historic Usage

An optional object for Event Based Components, will be returned if provided `include=historic_usages` query param.

## Structure

`HistoricUsage`

## Fields

| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `totalUsageQuantity` | `?float` | Optional | Total usage of a component for billing period | getTotalUsageQuantity(): ?float | setTotalUsageQuantity(?float totalUsageQuantity): void |
| `billingPeriodStartsAt` | `?DateTime` | Optional | Start date of billing period | getBillingPeriodStartsAt(): ?\DateTime | setBillingPeriodStartsAt(?\DateTime billingPeriodStartsAt): void |
| `billingPeriodEndsAt` | `?DateTime` | Optional | End date of billing period | getBillingPeriodEndsAt(): ?\DateTime | setBillingPeriodEndsAt(?\DateTime billingPeriodEndsAt): void |

## Example (as JSON)

```json
{
"total_usage_quantity": 26.6,
"billing_period_starts_at": "2016-03-13T12:52:32.123Z",
"billing_period_ends_at": "2016-03-13T12:52:32.123Z"
}
```

22 changes: 22 additions & 0 deletions doc/models/include-null-or-not-null.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# Include Null or Not Null

Allows to filter by `not_null` or `null`.

## Enumeration

`IncludeNullOrNotNull`

## Fields

| Name |
| --- |
| `NOT_NULL` |
| `NULL` |

## Example

```
not_null
```

2 changes: 1 addition & 1 deletion doc/models/issue-service-credit.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `amount` | float\|string | Required | This is a container for one-of cases. | getAmount(): | setAmount( amount): void |
| `memo` | `string` | Required | - | getMemo(): string | setMemo(string memo): void |
| `memo` | `?string` | Optional | - | getMemo(): ?string | setMemo(?string memo): void |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/list-price-points-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
| `endDatetime` | `?DateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | getEndDatetime(): ?\DateTime | setEndDatetime(?\DateTime endDatetime): void |
| `type` | [`?(string(PricePointType)[])`](../../doc/models/price-point-type.md) | Optional | Allows fetching price points with matching type. Use in query: `filter[type]=custom,catalog`. | getType(): ?array | setType(?array type): void |
| `ids` | `?(int[])` | Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | getIds(): ?array | setIds(?array ids): void |
| `archivedAt` | [`?string(IncludeNotNull)`](../../doc/models/include-not-null.md) | Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | getArchivedAt(): ?string | setArchivedAt(?string archivedAt): void |
| `archivedAt` | [`?string(IncludeNullOrNotNull)`](../../doc/models/include-null-or-not-null.md) | Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | getArchivedAt(): ?string | setArchivedAt(?string archivedAt): void |

## Example (as JSON)

Expand Down
1 change: 1 addition & 0 deletions doc/models/list-subscription-components-include.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
| Name |
| --- |
| `SUBSCRIPTION` |
| `HISTORIC_USAGES` |

## Example

Expand Down
36 changes: 0 additions & 36 deletions doc/models/prepayment-aggregated-error.md

This file was deleted.

Loading
Loading