-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
src/Payloads/CreateCompanyMicrosoft365BackupResourcePayload.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
namespace Shellrent\VeeamVspcApiClient\Payloads; | ||
|
||
class CreateCompanyMicrosoft365BackupResourcePayload implements Payload { | ||
private $RepositoryUid; | ||
|
||
private $ProxyUid; | ||
|
||
private $UsersQuota; | ||
|
||
private $IsUsersQuotaUnlimited; | ||
|
||
|
||
/** | ||
* @param mixed $RepositoryUid | ||
*/ | ||
public function setRepositoryUid( $RepositoryUid ) { | ||
$this->RepositoryUid = $RepositoryUid; | ||
|
||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @param mixed $ProxyUid | ||
*/ | ||
public function setProxyUid( $ProxyUid ) { | ||
$this->ProxyUid = $ProxyUid; | ||
|
||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @param mixed $UsersQuota | ||
*/ | ||
public function setUsersQuota( $UsersQuota ) { | ||
$this->UsersQuota = $UsersQuota; | ||
|
||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @param mixed $IsUsersQuotaUnlimited | ||
*/ | ||
public function setIsUsersQuotaUnlimited( $IsUsersQuotaUnlimited ) { | ||
$this->IsUsersQuotaUnlimited = $IsUsersQuotaUnlimited; | ||
|
||
return $this; | ||
} | ||
|
||
public function getBody() { | ||
$body = [ | ||
"repositoryUid" => $this->RepositoryUid, | ||
"proxyUid" => $this->ProxyUid, | ||
"usersQuota" => $this->UsersQuota ?? null, | ||
"isUsersQuotaUnlimited" => $this->IsUsersQuotaUnlimited ?? null, | ||
]; | ||
|
||
return json_encode( $body ); | ||
} | ||
|
||
public function getContentType(): string { | ||
return 'application/json'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace Shellrent\VeeamVspcApiClient\Payloads; | ||
|
||
class CreateCompanyMicrosoft365ResourcePayload implements Payload { | ||
private $Vb365ServerUid; | ||
|
||
private $FriendlyName; | ||
|
||
private $IsJobSchedulingEnabled; | ||
|
||
/** | ||
* @param mixed $Vb365ServerUid | ||
*/ | ||
public function setVb365ServerUid( $Vb365ServerUid ) { | ||
$this->Vb365ServerUid = $Vb365ServerUid; | ||
|
||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @param mixed $FriendlyName | ||
*/ | ||
public function setFriendlyName( $FriendlyName ) { | ||
$this->FriendlyName = $FriendlyName; | ||
|
||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @param mixed $IsJobSchedulingEnabled | ||
*/ | ||
public function setIsJobSchedulingEnabled( $IsJobSchedulingEnabled ) { | ||
$this->IsJobSchedulingEnabled = $IsJobSchedulingEnabled; | ||
|
||
return $this; | ||
} | ||
|
||
public function getBody() { | ||
$body = [ | ||
"vb365ServerUid" => $this->Vb365ServerUid, | ||
"friendlyName" => $this->FriendlyName, | ||
"isJobSchedulingEnabled" => $this->IsJobSchedulingEnabled ?? false, | ||
]; | ||
|
||
return json_encode( $body ); | ||
} | ||
|
||
public function getContentType(): string { | ||
return 'application/json'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Shellrent\VeeamVspcApiClient\Payloads; | ||
|
||
class ModifyCompanyResourcePayload implements Payload { | ||
private ?int $UsersQuota = null; | ||
|
||
private ?int $UsersQuotaUnlimited = null; | ||
|
||
public function setUsersQuota( ?int $UsersQuota ) { | ||
$this->UsersQuota = $UsersQuota; | ||
|
||
return $this; | ||
} | ||
|
||
public function setUsersQuotaUnlimited( ?int $UsersQuotaUnlimited ) { | ||
$this->UsersQuotaUnlimited = $UsersQuotaUnlimited; | ||
|
||
return $this; | ||
} | ||
|
||
public function getBody() { | ||
$body = []; | ||
|
||
if ( !is_null( $this->UsersQuota ) ) { | ||
$body[] = [ | ||
'value' => $this->UsersQuota, | ||
'path' => '/usersQuota', | ||
'op' => 'replace', | ||
]; | ||
} | ||
|
||
if ( !is_null( $this->UsersQuotaUnlimited ) ) { | ||
$body[] = [ | ||
'value' => $this->UsersQuotaUnlimited, | ||
'path' => '/isUsersQuotaUnlimited', | ||
'op' => 'replace', | ||
]; | ||
} | ||
|
||
return json_encode( $body ); | ||
} | ||
|
||
public function getContentType(): string { | ||
return 'application/json'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters