Skip to content
Open
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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 239
openapi_spec_hash: 49d468466a752f8ea72af00d00683f50
openapi_spec_hash: 401f6df4ddb87d8ac1109027a32db945
config_hash: 1ca082e374ef7000e2a5971e8da740e0
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ final class PhysicalCheck implements BaseModel
public ?string $checkVoucherImageFileID;

/**
* The descriptor that will be printed on the letter included with the check.
* A few paragraphs of text printed on the letter included with the check. It can contain at most 24 lines. Paragraphs will wrap at about 120 characters, but depending on your exact message, it might be slightly more or slightly less.
*/
#[Optional]
public ?string $note;
Expand Down Expand Up @@ -260,7 +260,7 @@ public function withCheckVoucherImageFileID(
}

/**
* The descriptor that will be printed on the letter included with the check.
* A few paragraphs of text printed on the letter included with the check. It can contain at most 24 lines. Paragraphs will wrap at about 120 characters, but depending on your exact message, it might be slightly more or slightly less.
*/
public function withNote(string $note): self
{
Expand Down
26 changes: 26 additions & 0 deletions src/Entities/EntityCreateParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Increase\Entities\EntityCreateParams\Joint;
use Increase\Entities\EntityCreateParams\NaturalPerson;
use Increase\Entities\EntityCreateParams\RiskRating;
use Increase\Entities\EntityCreateParams\SoleProprietorship;
use Increase\Entities\EntityCreateParams\Structure;
use Increase\Entities\EntityCreateParams\SupplementalDocument;
use Increase\Entities\EntityCreateParams\TermsAgreement;
Expand All @@ -30,6 +31,7 @@
* @phpstan-import-type JointShape from \Increase\Entities\EntityCreateParams\Joint
* @phpstan-import-type NaturalPersonShape from \Increase\Entities\EntityCreateParams\NaturalPerson
* @phpstan-import-type RiskRatingShape from \Increase\Entities\EntityCreateParams\RiskRating
* @phpstan-import-type SoleProprietorshipShape from \Increase\Entities\EntityCreateParams\SoleProprietorship
* @phpstan-import-type SupplementalDocumentShape from \Increase\Entities\EntityCreateParams\SupplementalDocument
* @phpstan-import-type TermsAgreementShape from \Increase\Entities\EntityCreateParams\TermsAgreement
* @phpstan-import-type ThirdPartyVerificationShape from \Increase\Entities\EntityCreateParams\ThirdPartyVerification
Expand All @@ -43,6 +45,7 @@
* joint?: null|Joint|JointShape,
* naturalPerson?: null|NaturalPerson|NaturalPersonShape,
* riskRating?: null|RiskRating|RiskRatingShape,
* soleProprietorship?: null|SoleProprietorship|SoleProprietorshipShape,
* supplementalDocuments?: list<SupplementalDocument|SupplementalDocumentShape>|null,
* termsAgreements?: list<TermsAgreement|TermsAgreementShape>|null,
* thirdPartyVerification?: null|ThirdPartyVerification|ThirdPartyVerificationShape,
Expand Down Expand Up @@ -99,6 +102,12 @@ final class EntityCreateParams implements BaseModel
#[Optional('risk_rating')]
public ?RiskRating $riskRating;

/**
* Details of the sole proprietorship entity to create. Required if `structure` is equal to `sole_proprietorship`.
*/
#[Optional('sole_proprietorship')]
public ?SoleProprietorship $soleProprietorship;

/**
* Additional documentation associated with the entity.
*
Expand Down Expand Up @@ -157,6 +166,7 @@ public function __construct()
* @param Joint|JointShape|null $joint
* @param NaturalPerson|NaturalPersonShape|null $naturalPerson
* @param RiskRating|RiskRatingShape|null $riskRating
* @param SoleProprietorship|SoleProprietorshipShape|null $soleProprietorship
* @param list<SupplementalDocument|SupplementalDocumentShape>|null $supplementalDocuments
* @param list<TermsAgreement|TermsAgreementShape>|null $termsAgreements
* @param ThirdPartyVerification|ThirdPartyVerificationShape|null $thirdPartyVerification
Expand All @@ -170,6 +180,7 @@ public static function with(
Joint|array|null $joint = null,
NaturalPerson|array|null $naturalPerson = null,
RiskRating|array|null $riskRating = null,
SoleProprietorship|array|null $soleProprietorship = null,
?array $supplementalDocuments = null,
?array $termsAgreements = null,
ThirdPartyVerification|array|null $thirdPartyVerification = null,
Expand All @@ -185,6 +196,7 @@ public static function with(
null !== $joint && $self['joint'] = $joint;
null !== $naturalPerson && $self['naturalPerson'] = $naturalPerson;
null !== $riskRating && $self['riskRating'] = $riskRating;
null !== $soleProprietorship && $self['soleProprietorship'] = $soleProprietorship;
null !== $supplementalDocuments && $self['supplementalDocuments'] = $supplementalDocuments;
null !== $termsAgreements && $self['termsAgreements'] = $termsAgreements;
null !== $thirdPartyVerification && $self['thirdPartyVerification'] = $thirdPartyVerification;
Expand Down Expand Up @@ -283,6 +295,20 @@ public function withRiskRating(RiskRating|array $riskRating): self
return $self;
}

/**
* Details of the sole proprietorship entity to create. Required if `structure` is equal to `sole_proprietorship`.
*
* @param SoleProprietorship|SoleProprietorshipShape $soleProprietorship
*/
public function withSoleProprietorship(
SoleProprietorship|array $soleProprietorship
): self {
$self = clone $this;
$self['soleProprietorship'] = $soleProprietorship;

return $self;
}

/**
* Additional documentation associated with the entity.
*
Expand Down
208 changes: 208 additions & 0 deletions src/Entities/EntityCreateParams/SoleProprietorship.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
<?php

declare(strict_types=1);

namespace Increase\Entities\EntityCreateParams;

use Increase\Core\Attributes\Optional;
use Increase\Core\Attributes\Required;
use Increase\Core\Concerns\SdkModel;
use Increase\Core\Contracts\BaseModel;
use Increase\Entities\EntityCreateParams\SoleProprietorship\Address;
use Increase\Entities\EntityCreateParams\SoleProprietorship\SoleProprietor;

/**
* Details of the sole proprietorship entity to create. Required if `structure` is equal to `sole_proprietorship`.
*
* @phpstan-import-type AddressShape from \Increase\Entities\EntityCreateParams\SoleProprietorship\Address
* @phpstan-import-type SoleProprietorShape from \Increase\Entities\EntityCreateParams\SoleProprietorship\SoleProprietor
*
* @phpstan-type SoleProprietorshipShape = array{
* address: Address|AddressShape,
* soleProprietor: SoleProprietor|SoleProprietorShape,
* doingBusinessAsName?: string|null,
* email?: string|null,
* industryCode?: string|null,
* taxIdentifier?: string|null,
* website?: string|null,
* }
*/
final class SoleProprietorship implements BaseModel
{
/** @use SdkModel<SoleProprietorshipShape> */
use SdkModel;

/**
* The sole proprietorship's business address. Mail receiving locations like PO Boxes and PMB's are disallowed.
*/
#[Required]
public Address $address;

/**
* The individual who operates the sole proprietorship.
*/
#[Required('sole_proprietor')]
public SoleProprietor $soleProprietor;

/**
* The name under which the sole proprietorship does business, if it is different from the name of the sole proprietor.
*/
#[Optional('doing_business_as_name')]
public ?string $doingBusinessAsName;

/**
* An email address for the sole proprietorship. Not every program requires an email for submitted Entities.
*/
#[Optional]
public ?string $email;

/**
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
#[Optional('industry_code')]
public ?string $industryCode;

/**
* The United States Employer Identification Number (EIN) for the sole proprietorship, if the sole proprietor has one. Submit nine digits with no dashes or other separators.
*/
#[Optional('tax_identifier')]
public ?string $taxIdentifier;

/**
* A website for the sole proprietorship. Not every program requires a website for submitted Entities.
*/
#[Optional]
public ?string $website;

/**
* `new SoleProprietorship()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* SoleProprietorship::with(address: ..., soleProprietor: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new SoleProprietorship)->withAddress(...)->withSoleProprietor(...)
* ```
*/
public function __construct()
{
$this->initialize();
}

/**
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*
* @param Address|AddressShape $address
* @param SoleProprietor|SoleProprietorShape $soleProprietor
*/
public static function with(
Address|array $address,
SoleProprietor|array $soleProprietor,
?string $doingBusinessAsName = null,
?string $email = null,
?string $industryCode = null,
?string $taxIdentifier = null,
?string $website = null,
): self {
$self = new self;

$self['address'] = $address;
$self['soleProprietor'] = $soleProprietor;

null !== $doingBusinessAsName && $self['doingBusinessAsName'] = $doingBusinessAsName;
null !== $email && $self['email'] = $email;
null !== $industryCode && $self['industryCode'] = $industryCode;
null !== $taxIdentifier && $self['taxIdentifier'] = $taxIdentifier;
null !== $website && $self['website'] = $website;

return $self;
}

/**
* The sole proprietorship's business address. Mail receiving locations like PO Boxes and PMB's are disallowed.
*
* @param Address|AddressShape $address
*/
public function withAddress(Address|array $address): self
{
$self = clone $this;
$self['address'] = $address;

return $self;
}

/**
* The individual who operates the sole proprietorship.
*
* @param SoleProprietor|SoleProprietorShape $soleProprietor
*/
public function withSoleProprietor(
SoleProprietor|array $soleProprietor
): self {
$self = clone $this;
$self['soleProprietor'] = $soleProprietor;

return $self;
}

/**
* The name under which the sole proprietorship does business, if it is different from the name of the sole proprietor.
*/
public function withDoingBusinessAsName(string $doingBusinessAsName): self
{
$self = clone $this;
$self['doingBusinessAsName'] = $doingBusinessAsName;

return $self;
}

/**
* An email address for the sole proprietorship. Not every program requires an email for submitted Entities.
*/
public function withEmail(string $email): self
{
$self = clone $this;
$self['email'] = $email;

return $self;
}

/**
* The North American Industry Classification System (NAICS) code for the sole proprietorship's primary line of business. This is a number, like `5132` for `Software Publishers`. A full list of classification codes is available [here](https://increase.com/documentation/data-dictionary#north-american-industry-classification-system-codes).
*/
public function withIndustryCode(string $industryCode): self
{
$self = clone $this;
$self['industryCode'] = $industryCode;

return $self;
}

/**
* The United States Employer Identification Number (EIN) for the sole proprietorship, if the sole proprietor has one. Submit nine digits with no dashes or other separators.
*/
public function withTaxIdentifier(string $taxIdentifier): self
{
$self = clone $this;
$self['taxIdentifier'] = $taxIdentifier;

return $self;
}

/**
* A website for the sole proprietorship. Not every program requires a website for submitted Entities.
*/
public function withWebsite(string $website): self
{
$self = clone $this;
$self['website'] = $website;

return $self;
}
}
Loading