Skip to content

Commit

Permalink
(feat) update the SDK according to the openapi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierlacot committed Aug 17, 2023
1 parent 369d47d commit da468cb
Show file tree
Hide file tree
Showing 14 changed files with 277 additions and 73 deletions.
30 changes: 18 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changes between versions

## Unreleased

* updated the SDK based on the latest [spec updates](jolicode/harvest-openapi-generator#27)
* updated the spec according to the current documentation
* fixed several definitions

## 6.2.0 (2023-04-19)

* upgrade to `janephp/open-api` 7.4
Expand All @@ -18,7 +24,7 @@
* add the ability to retrieve message subject and body for specific invoices as defined in https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#retrieve-invoice-message-subject-and-body-for-specific-invoice

## 6.0.0 (2022-08-04)

* upgrade to `janephp/open-api` 7.3
* drop support for PHP <7.4
* updated the SDK based on the latest [spec updates](jolicode/harvest-openapi-generator#20)
Expand Down Expand Up @@ -101,26 +107,26 @@
* added the `Invoice` `recurring_invoice_id` attribute

## 2.0.0 (2019-10-28)
* Upgrade Jane to 4.5 https://github.com/janephp/janephp/releases/tag/v4.5.3, the new generated classes have better PHPDoc​
* Generate PSR-18 client instead of HttPlug client
* Support for cost and billable rates
* Removed the telephone property from the user model
* Added statement_key in the Client properties

* Upgrade Jane to 4.5 https://github.com/janephp/janephp/releases/tag/v4.5.3, the new generated classes have better PHPDoc​
* Generate PSR-18 client instead of HttPlug client
* Support for cost and billable rates
* Removed the telephone property from the user model
* Added statement_key in the Client properties

## 1.1.0 (2019-04-01)

* Support HTTPlug 2
* Support HTTPlug 2

## 1.0.2 (2019-01-24)

* support null values for nested objects or values (jane-openapi strict mode false)
* changed `quantity` types to `float` instead of `integer`
* support null values for nested objects or values (jane-openapi strict mode false)
* changed `quantity` types to `float` instead of `integer`

## 1.0.1 (2019-01-22)

* Fixed the `deleteTimeEntryExternalReference` endpoint operationId
* Fixed the `deleteTimeEntryExternalReference` endpoint operationId

## 1.0.0 (2019-01-21)

* Initial release
* Initial release
53 changes: 47 additions & 6 deletions Resources/harvest-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,9 @@ components:
nullable: true
include_link_to_client_invoice:
type: boolean
description: 'Whether to include a link to the client invoice in the message body. Not used when thank_you is true.'
description: 'DEPRECATED This will be true when payment_options are assigned to the invoice and false when there are no payment_options.'
nullable: true
deprecated: true
attach_pdf:
type: boolean
description: 'Whether to attach the invoice PDF to the message email.'
Expand Down Expand Up @@ -515,6 +516,16 @@ components:
type: string
description: 'The timeframe in which the invoice should be paid. Options: upon receipt, net 15, net 30, net 45, net 60, or custom.'
nullable: true
payment_options:
type: array
description: 'The list of payment options enabled for the invoice. Options: [ach, credit_card, paypal]'
nullable: true
items:
type: string
enum:
- ach
- credit_card
- paypal
sent_at:
type: string
description: 'Date and time the invoice was sent.'
Expand Down Expand Up @@ -1152,7 +1163,6 @@ components:
type: integer
description: 'Unique ID for the time entry.'
nullable: true
format: int32
spent_date:
type: string
description: 'Date of the time entry.'
Expand Down Expand Up @@ -1619,7 +1629,7 @@ components:
url: 'https://help.getharvest.com/api-v2/users-api/users/teammates/#the-teammate-object'
properties:
id:
type: int
type: integer
description: 'Unique ID for the teammate'
nullable: true
first_name:
Expand Down Expand Up @@ -6130,6 +6140,8 @@ paths:
created_at: '2017-06-27T16:27:16Z'
updated_at: '2017-08-23T22:25:59Z'
currency: EUR
payment_options:
- credit_card
client:
id: 5735776
name: '123 Industries'
Expand Down Expand Up @@ -6338,6 +6350,8 @@ paths:
created_at: '2017-06-27T16:34:24Z'
updated_at: '2017-06-27T16:34:24Z'
currency: USD
payment_options:
- credit_card
client:
id: 5735774
name: 'ABC Corp'
Expand Down Expand Up @@ -6430,6 +6444,16 @@ paths:
type: string
description: 'The timeframe in which the invoice should be paid. Defaults to custom. Options: upon receipt, net 15, net 30, net 45, net 60, or custom.'
nullable: true
payment_options:
type: array
description: 'The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach, credit_card, paypal]'
nullable: true
items:
type: string
enum:
- ach
- credit_card
- paypal
line_items_import:
type: object
description: 'An line items import object'
Expand Down Expand Up @@ -6481,7 +6505,7 @@ paths:
description: 'If set to true, a PDF containing an expense report with receipts will be attached to the invoice. Defaults to false.'
retainer_id:
type: integer
description: 'The ID of the retainer you want to add funds to with this invoice. Note: retainers cannot be fully used (created, drawn against, closed, etc.) via the API at this time. The only avaiable action is to add funds.'
description: 'The ID of the retainer you want to add funds to with this invoice. Note: retainers cannot be fully used (created, drawn against, closed, etc.) via the API at this time. The only available action is to add funds.'
nullable: true
format: int32
line_items:
Expand Down Expand Up @@ -6595,6 +6619,8 @@ paths:
created_at: '2017-06-27T16:24:30Z'
updated_at: '2017-06-27T16:24:57Z'
currency: USD
payment_options:
- credit_card
client:
id: 5735776
name: '123 Industries'
Expand Down Expand Up @@ -6678,6 +6704,8 @@ paths:
created_at: '2017-06-27T16:34:24Z'
updated_at: '2017-06-27T16:36:33Z'
currency: USD
payment_options:
- credit_card
client:
id: 5735774
name: 'ABC Corp'
Expand Down Expand Up @@ -6782,6 +6810,16 @@ paths:
type: string
description: 'The timeframe in which the invoice should be paid. Options: upon receipt, net 15, net 30, net 45, or net 60.'
nullable: true
payment_options:
type: array
description: 'The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach, credit_card, paypal]'
nullable: true
items:
type: string
enum:
- ach
- credit_card
- paypal
line_items:
type: array
description: 'Array of line item parameters'
Expand Down Expand Up @@ -7029,8 +7067,9 @@ paths:
nullable: true
include_link_to_client_invoice:
type: boolean
description: 'If set to true, a link to the client invoice URL will be included in the message email. Defaults to false. Ignored when thank_you is set to true.'
description: 'DEPRECATED A link to the client invoice URL will be automatically included in the message email if payment_options have been assigned to the invoice. Setting to true will be ignored. Setting to false will clear all payment_options on the invoice.'
nullable: true
deprecated: true
attach_pdf:
type: boolean
description: 'If set to true, a PDF of the invoice will be attached to the message email. Defaults to false.'
Expand Down Expand Up @@ -12800,8 +12839,10 @@ paths:
type: object
properties:
teammate_ids:
type: 'array of user ids'
type: array
description: 'Full list of user IDs to be assigned to the Manager.'
nullable: true
items:
type: string
required:
- teammate_ids
3 changes: 3 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Instead of the `listClients()` method above, you can use all of these methods:
* `updateInvoice()`
* `listMessagesForInvoice()`
* `createInvoiceMessage()`
* `retrieveInvoiceMessageSubjectAndBodyForSpecificInvoice()`
* `deleteInvoiceMessage()`
* `listPaymentsForInvoice()`
* `createInvoicePayment()`
Expand Down Expand Up @@ -175,6 +176,8 @@ Instead of the `listClients()` method above, you can use all of these methods:
* `createCostRate()`
* `retrieveCostRate()`
* `listActiveProjectAssignments()`
* `listAssignedTeammatesForSpecificUser()`
* `updateUserAssignedTeammates()`

## Examples

Expand Down
29 changes: 29 additions & 0 deletions generated/Model/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ class Invoice extends \ArrayObject
* @var string|null
*/
protected $paymentTerm;
/**
* The list of payment options enabled for the invoice. Options: [ach, credit_card, paypal].
*
* @var string[]|null
*/
protected $paymentOptions;
/**
* Date and time the invoice was sent.
*
Expand Down Expand Up @@ -719,6 +725,29 @@ public function setPaymentTerm(?string $paymentTerm): self
return $this;
}

/**
* The list of payment options enabled for the invoice. Options: [ach, credit_card, paypal].
*
* @return string[]|null
*/
public function getPaymentOptions(): ?array
{
return $this->paymentOptions;
}

/**
* The list of payment options enabled for the invoice. Options: [ach, credit_card, paypal].
*
* @param string[]|null $paymentOptions
*/
public function setPaymentOptions(?array $paymentOptions): self
{
$this->initialized['paymentOptions'] = true;
$this->paymentOptions = $paymentOptions;

return $this;
}

/**
* Date and time the invoice was sent.
*/
Expand Down
12 changes: 9 additions & 3 deletions generated/Model/InvoiceMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class InvoiceMessage extends \ArrayObject
*/
protected $body;
/**
* Whether to include a link to the client invoice in the message body. Not used when thank_you is true.
* DEPRECATED This will be true when payment_options are assigned to the invoice and false when there are no payment_options.
*
* @deprecated
*
* @var bool|null
*/
Expand Down Expand Up @@ -282,15 +284,19 @@ public function setBody(?string $body): self
}

/**
* Whether to include a link to the client invoice in the message body. Not used when thank_you is true.
* DEPRECATED This will be true when payment_options are assigned to the invoice and false when there are no payment_options.
*
* @deprecated
*/
public function getIncludeLinkToClientInvoice(): ?bool
{
return $this->includeLinkToClientInvoice;
}

/**
* Whether to include a link to the client invoice in the message body. Not used when thank_you is true.
* DEPRECATED This will be true when payment_options are assigned to the invoice and false when there are no payment_options.
*
* @deprecated
*/
public function setIncludeLinkToClientInvoice(?bool $includeLinkToClientInvoice): self
{
Expand Down
12 changes: 9 additions & 3 deletions generated/Model/InvoicesInvoiceIdMessagesPostBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ class InvoicesInvoiceIdMessagesPostBody extends \ArrayObject
*/
protected $body;
/**
* If set to true, a link to the client invoice URL will be included in the message email. Defaults to false. Ignored when thank_you is set to true.
* DEPRECATED A link to the client invoice URL will be automatically included in the message email if payment_options have been assigned to the invoice. Setting to true will be ignored. Setting to false will clear all payment_options on the invoice.
*
* @deprecated
*
* @var bool|null
*/
Expand Down Expand Up @@ -152,15 +154,19 @@ public function setBody(?string $body): self
}

/**
* If set to true, a link to the client invoice URL will be included in the message email. Defaults to false. Ignored when thank_you is set to true.
* DEPRECATED A link to the client invoice URL will be automatically included in the message email if payment_options have been assigned to the invoice. Setting to true will be ignored. Setting to false will clear all payment_options on the invoice.
*
* @deprecated
*/
public function getIncludeLinkToClientInvoice(): ?bool
{
return $this->includeLinkToClientInvoice;
}

/**
* If set to true, a link to the client invoice URL will be included in the message email. Defaults to false. Ignored when thank_you is set to true.
* DEPRECATED A link to the client invoice URL will be automatically included in the message email if payment_options have been assigned to the invoice. Setting to true will be ignored. Setting to false will clear all payment_options on the invoice.
*
* @deprecated
*/
public function setIncludeLinkToClientInvoice(?bool $includeLinkToClientInvoice): self
{
Expand Down
29 changes: 29 additions & 0 deletions generated/Model/InvoicesInvoiceIdPatchBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ class InvoicesInvoiceIdPatchBody extends \ArrayObject
* @var string|null
*/
protected $paymentTerm;
/**
* The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach, credit_card, paypal].
*
* @var string[]|null
*/
protected $paymentOptions;
/**
* Array of line item parameters.
*
Expand Down Expand Up @@ -379,6 +385,29 @@ public function setPaymentTerm(?string $paymentTerm): self
return $this;
}

/**
* The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach, credit_card, paypal].
*
* @return string[]|null
*/
public function getPaymentOptions(): ?array
{
return $this->paymentOptions;
}

/**
* The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach, credit_card, paypal].
*
* @param string[]|null $paymentOptions
*/
public function setPaymentOptions(?array $paymentOptions): self
{
$this->initialized['paymentOptions'] = true;
$this->paymentOptions = $paymentOptions;

return $this;
}

/**
* Array of line item parameters.
*
Expand Down
Loading

0 comments on commit da468cb

Please sign in to comment.