Skip to content

Commit 8353a18

Browse files
authored
Merge pull request #29 from jolicode/feature/spec-update-20241205
Spec update 20241205
2 parents 3b007d6 + 2ec250b commit 8353a18

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
}
1717
},
1818
"require": {
19-
"symfony/console": "^7.0.4",
20-
"symfony/dom-crawler": "^7.0.4",
21-
"symfony/css-selector": "^7.0.3",
22-
"symfony/yaml": "^7.0.3"
19+
"symfony/console": "^7.2.0",
20+
"symfony/dom-crawler": "^7.2.0",
21+
"symfony/css-selector": "^7.2.0",
22+
"symfony/yaml": "^7.2.0"
2323
},
2424
"require-dev": {
25-
"friendsofphp/php-cs-fixer": "^3.52.1"
25+
"friendsofphp/php-cs-fixer": "^3.65.0"
2626
}
2727
}

generated/harvest-openapi.yaml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ components:
270270
nullable: true
271271
event_type:
272272
type: string
273-
description: 'The type of invoice event that occurred with the message: send, close, draft, re-open, or view.'
273+
description: 'The type of invoice event that occurred with the message: close, draft, re-open, or send (marked the invoice as sent). If event_type was omitted in the request, a null value is returned, meaning the invoice was sent.'
274274
nullable: true
275275
reminder:
276276
type: boolean
@@ -6975,19 +6975,19 @@ paths:
69756975
schema:
69766976
type: integer
69776977
post:
6978-
summary: 'Create an invoice message or change invoice status'
6978+
summary: 'Create and send an invoice message'
69796979
operationId: createInvoiceMessage
6980-
description: 'Creates a new invoice message object. Returns an invoice message object and a 201 Created response code if the call succeeded.'
6980+
description: "Creates a new invoice message object and sends it. Returns an invoice message object and a 201 Created response code if the call succeeded.\n\nA note about the optional event_type parameter: If event_type is omitted in a request, its default value of null means the message will be sent. In such a request, if the recipients array is omitted or empty and send_me_a_copy is also omitted or set to false, the request will fail because the message has no recipients. When omitting event_type to create and send a message, be sure to include a recipients array as a parameter or ensure the send_me_a_copy parameter is included and set to true."
69816981
externalDocs:
6982-
description: 'Create an invoice message'
6983-
url: 'https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#create-an-invoice-message'
6982+
description: 'Create and send an invoice message'
6983+
url: 'https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#create-and-send-an-invoice-message'
69846984
security:
69856985
-
69866986
BearerAuth: []
69876987
AccountAuth: []
69886988
responses:
69896989
201:
6990-
description: 'Create an invoice message or change invoice status'
6990+
description: 'Create and send an invoice message'
69916991
content:
69926992
application/json:
69936993
schema:
@@ -7039,11 +7039,11 @@ paths:
70397039
properties:
70407040
event_type:
70417041
type: string
7042-
description: 'If provided, runs an event against the invoice. Options: close, draft, re-open, or send.'
7042+
description: 'Omit when intending to create and send a message. If omitted, the default value is null and the message will be sent. See other sections below for including this parameter with the following options: close, draft, re-open, or send (which marks a draft invoice as sent, it does not send the message).'
70437043
nullable: true
70447044
recipients:
70457045
type: array
7046-
description: 'Array of recipient parameters. See below for details.'
7046+
description: 'Array of recipient parameters. See below for more details.'
70477047
nullable: true
70487048
items:
70497049
type: object
@@ -7082,8 +7082,6 @@ paths:
70827082
type: boolean
70837083
description: 'If set to true, a thank you message email will be sent. Defaults to false.'
70847084
nullable: true
7085-
required:
7086-
- recipients
70877085
'/invoices/{invoiceId}/messages/new':
70887086
get:
70897087
summary: 'Retrieve invoice message subject and body for specific invoice'
@@ -9548,6 +9546,13 @@ paths:
95489546
in: query
95499547
schema:
95509548
type: string
9549+
-
9550+
name: include_fixed_fee
9551+
description: 'Whether or not to include fixed-fee projects in the response. (Default: true)'
9552+
required: false
9553+
in: query
9554+
schema:
9555+
type: boolean
95519556
-
95529557
name: page
95539558
description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)'
@@ -12135,16 +12140,6 @@ paths:
1213512140
description: 'The number of hours per week this person is available to work in seconds.'
1213612141
nullable: true
1213712142
format: int32
12138-
default_hourly_rate:
12139-
type: number
12140-
description: 'The billable rate to use for this user when they are added to a project.'
12141-
nullable: true
12142-
format: float
12143-
cost_rate:
12144-
type: number
12145-
description: 'The cost rate to use for this user when calculating a project’s costs vs billable amount.'
12146-
nullable: true
12147-
format: float
1214812143
roles:
1214912144
type: array
1215012145
description: 'Descriptive names of the business roles assigned to this person. They can be used for filtering reports, and have no effect in their permissions in Harvest.'

src/Dumper/Dumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function dump(array $data): array
163163
isset($data['components']['schemas'][$definition]['properties'])
164164
&& isset($data['components']['schemas'][$definition]['properties'][$propertyName])
165165
) {
166-
$warnings[] = sprintf(
166+
$warnings[] = \sprintf(
167167
'The property "%s" of the definition "%s" already exists and has been overriden.',
168168
$propertyName,
169169
$definition

src/Extractor/Extractor.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function buildDefinitionProperty($name, $type, $description, $path
118118
];
119119
}
120120

121-
if ('Array of recipient parameters. See below for details.' === $description) {
121+
if ('Array of recipient parameters. See below for details.' === $description || 'Array of recipient parameters. See below for more details.' === $description) {
122122
$property['items'] = [
123123
'type' => 'object',
124124
'required' => [
@@ -774,6 +774,10 @@ public static function guessPathResponseSchema($summary, $title)
774774
return '#/components/schemas/InvoiceMessageSubjectAndBody';
775775
}
776776

777+
if ('Create and send an invoice message' === $summary) {
778+
return '#/components/schemas/InvoiceMessage';
779+
}
780+
777781
return null;
778782
};
779783

@@ -887,7 +891,7 @@ private function printUnknownDefinitions(array $items)
887891
$item = substr($item, 21);
888892

889893
if (!isset($this->definitions[$item]) && !\in_array($item, ['Error', 'InvoiceMessageSubjectAndBody', 'TeammatesPatchResponse'], true)) {
890-
throw new \LogicException(sprintf('Unknown definition: %s', $item));
894+
throw new \LogicException(\sprintf('Unknown definition: %s', $item));
891895
}
892896
}
893897
}
@@ -898,6 +902,7 @@ private static function cleanupOperationId($operationId)
898902
$conversionMap = [
899903
'createFreeFormInvoice' => 'createInvoice',
900904
'createTimeEntryViaDuration' => 'createTimeEntry',
905+
'createAndSendInvoiceMessage' => 'createInvoiceMessage',
901906
];
902907

903908
return isset($conversionMap[$operationId]) ? $conversionMap[$operationId] : $operationId;

0 commit comments

Comments
 (0)