Skip to content

Commit

Permalink
Update generated code (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
silas authored May 16, 2024
1 parent 6a834df commit dfcf020
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 2 deletions.
11 changes: 11 additions & 0 deletions lib/AdminV1/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ final class Organization implements \JsonSerializable, JsonUnserializable
*/
public null|\DateTimeInterface $signupTime;

/**
* The number of members in the organization.
*
* This includes disabled users, but does not include user's marked for deletion.
*/
public int $memberCount;

/**
* Whether the organization is disabled.
*/
Expand Down Expand Up @@ -144,6 +151,7 @@ public function __construct(
null|array $accountConnections = null,
null|AccountSubscription $subscription = null,
null|\DateTimeInterface $signupTime = null,
null|int $memberCount = null,
null|bool $disabled = null,
null|\DateTimeInterface $createTime = null,
null|\DateTimeInterface $updateTime = null,
Expand All @@ -166,6 +174,7 @@ public function __construct(
$this->accountConnections = $accountConnections ?? [];
$this->subscription = $subscription ?? null;
$this->signupTime = $signupTime ?? null;
$this->memberCount = $memberCount ?? 0;
$this->disabled = $disabled ?? null;
$this->createTime = $createTime ?? Util::emptyDateTime();
$this->updateTime = $updateTime ?? Util::emptyDateTime();
Expand All @@ -192,6 +201,7 @@ public function jsonSerialize(): mixed
'accountConnections' => $this->accountConnections ?? null,
'subscription' => $this->subscription ?? null,
'signupTime' => isset($this->signupTime) ? Util::encodeDateTime($this->signupTime) : null,
'memberCount' => $this->memberCount ?? null,
'disabled' => $this->disabled ?? null,
'createTime' => isset($this->createTime) ? Util::encodeDateTime($this->createTime) : null,
'updateTime' => isset($this->updateTime) ? Util::encodeDateTime($this->updateTime) : null,
Expand Down Expand Up @@ -223,6 +233,7 @@ public static function jsonUnserialize(mixed $data): static
isset($data->{'accountConnections'}) ? Util::mapArray($data->{'accountConnections'}, [AccountConnection::class, 'jsonUnserialize']) : null,
isset($data->{'subscription'}) ? AccountSubscription::jsonUnserialize($data->{'subscription'}) : null,
isset($data->{'signupTime'}) ? Util::decodeDateTime($data->{'signupTime'}) : null,
$data->{'memberCount'} ?? null,
$data->{'disabled'} ?? null,
isset($data->{'createTime'}) ? Util::decodeDateTime($data->{'createTime'}) : null,
isset($data->{'updateTime'}) ? Util::decodeDateTime($data->{'updateTime'}) : null,
Expand Down
4 changes: 2 additions & 2 deletions lib/Internal/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
abstract class Constants
{
public const API_BASE_URL = 'https://api.userhub.com';
public const USER_AGENT = 'UserHub-PHP/0.6.0';
public const VERSION = '0.6.0';
public const USER_AGENT = 'UserHub-PHP/0.6.1';
public const VERSION = '0.6.1';

public const AUTH_HEADER = 'Authorization';
public const API_KEY_HEADER = 'UserHub-Api-Key';
Expand Down
11 changes: 11 additions & 0 deletions lib/UserV1/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ final class Organization implements \JsonSerializable, JsonUnserializable
*/
public null|string $imageUrl;

/**
* The number of members in the organization.
*
* This includes disabled users, but does not include user's marked for deletion.
*/
public int $memberCount;

/**
* Whether the organization is disabled.
*/
Expand All @@ -55,6 +62,7 @@ public function __construct(
null|string $email = null,
null|bool $emailVerified = null,
null|string $imageUrl = null,
null|int $memberCount = null,
null|bool $disabled = null,
) {
$this->id = $id ?? '';
Expand All @@ -63,6 +71,7 @@ public function __construct(
$this->email = $email ?? null;
$this->emailVerified = $emailVerified ?? null;
$this->imageUrl = $imageUrl ?? null;
$this->memberCount = $memberCount ?? 0;
$this->disabled = $disabled ?? null;
}

Expand All @@ -75,6 +84,7 @@ public function jsonSerialize(): mixed
'email' => $this->email ?? null,
'emailVerified' => $this->emailVerified ?? null,
'imageUrl' => $this->imageUrl ?? null,
'memberCount' => $this->memberCount ?? null,
'disabled' => $this->disabled ?? null,
];
}
Expand All @@ -92,6 +102,7 @@ public static function jsonUnserialize(mixed $data): static
$data->{'email'} ?? null,
$data->{'emailVerified'} ?? null,
$data->{'imageUrl'} ?? null,
$data->{'memberCount'} ?? null,
$data->{'disabled'} ?? null,
);
}
Expand Down
4 changes: 4 additions & 0 deletions tests/AdminApi/FlowsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function testCreateJoinOrganization(): void
"anchorTime": "2024-02-05T23:07:46.483Z"
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -236,6 +237,7 @@ public function testCreateSignup(): void
"anchorTime": "2024-02-05T23:07:46.483Z"
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -385,6 +387,7 @@ public function testGet(): void
"anchorTime": "2024-02-05T23:07:46.483Z"
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -534,6 +537,7 @@ public function testCancel(): void
"anchorTime": "2024-02-05T23:07:46.483Z"
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down
8 changes: 8 additions & 0 deletions tests/AdminApi/OrganizationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function testList(): void
"regionCode": "US",
"timeZone": "America/New_York",
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -109,6 +110,7 @@ public function testCreate(): void
}
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -176,6 +178,7 @@ public function testGet(): void
}
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -243,6 +246,7 @@ public function testUpdate(): void
}
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -310,6 +314,7 @@ public function testDelete(): void
}
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -377,6 +382,7 @@ public function testUndelete(): void
}
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -444,6 +450,7 @@ public function testConnect(): void
}
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down Expand Up @@ -511,6 +518,7 @@ public function testDisconnect(): void
}
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down
1 change: 1 addition & 0 deletions tests/AdminApi/SubscriptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public function testGet(): void
"anchorTime": "2024-02-05T23:07:46.483Z"
},
"signupTime": "2024-02-05T23:07:46.483Z",
"memberCount": 1,
"disabled": true,
"createTime": "2024-02-05T23:07:46.483Z",
"updateTime": "2024-02-05T23:07:46.483Z"
Expand Down
6 changes: 6 additions & 0 deletions tests/UserApi/FlowsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function testCreateJoinOrganization(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
},
"user": {
Expand Down Expand Up @@ -129,6 +130,7 @@ public function testCreateSignup(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
},
"user": {
Expand Down Expand Up @@ -197,6 +199,7 @@ public function testGet(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
},
"user": {
Expand Down Expand Up @@ -265,6 +268,7 @@ public function testApprove(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
},
"user": {
Expand Down Expand Up @@ -333,6 +337,7 @@ public function testConsume(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
},
"user": {
Expand Down Expand Up @@ -401,6 +406,7 @@ public function testCancel(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
},
"user": {
Expand Down
4 changes: 4 additions & 0 deletions tests/UserApi/OrganizationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function testList(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
}
],
Expand Down Expand Up @@ -57,6 +58,7 @@ public function testCreate(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
}
EOD;
Expand All @@ -81,6 +83,7 @@ public function testGet(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
}
EOD;
Expand All @@ -105,6 +108,7 @@ public function testUpdate(): void
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/test.png",
"memberCount": 1,
"disabled": true
}
EOD;
Expand Down

0 comments on commit dfcf020

Please sign in to comment.