|
@@ -107,9 +107,15 @@ class GroupsApi
|
|
|
'postApiV3Groups' => [
|
|
'postApiV3Groups' => [
|
|
|
'application/json',
|
|
'application/json',
|
|
|
],
|
|
],
|
|
|
|
|
+ 'postApiV3GroupsGroupInviteLinks' => [
|
|
|
|
|
+ 'application/json',
|
|
|
|
|
+ ],
|
|
|
'postApiV3GroupsGroupMembers' => [
|
|
'postApiV3GroupsGroupMembers' => [
|
|
|
'application/json',
|
|
'application/json',
|
|
|
],
|
|
],
|
|
|
|
|
+ 'postApiV3MeGroups' => [
|
|
|
|
|
+ 'application/json',
|
|
|
|
|
+ ],
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -3641,40 +3647,38 @@ class GroupsApi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Operation postApiV3GroupsGroupMembers
|
|
|
|
|
|
|
+ * Operation postApiV3GroupsGroupInviteLinks
|
|
|
*
|
|
*
|
|
|
- * 加一名成员
|
|
|
|
|
|
|
+ * 签一张团队邀请链接
|
|
|
*
|
|
*
|
|
|
* @param string $group 团队 uid (required)
|
|
* @param string $group 团队 uid (required)
|
|
|
- * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request post_api_v3_groups_group_members_request (required)
|
|
|
|
|
- * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
|
|
|
*
|
|
*
|
|
|
* @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
|
|
* @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
|
|
|
* @throws \InvalidArgumentException
|
|
* @throws \InvalidArgumentException
|
|
|
- * @return \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
|
|
|
|
|
|
|
+ * @return \WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response|\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
|
|
|
*/
|
|
*/
|
|
|
- public function postApiV3GroupsGroupMembers($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
|
|
+ public function postApiV3GroupsGroupInviteLinks($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
|
|
|
{
|
|
{
|
|
|
- list($response) = $this->postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType);
|
|
|
|
|
|
|
+ list($response) = $this->postApiV3GroupsGroupInviteLinksWithHttpInfo($group, $contentType);
|
|
|
return $response;
|
|
return $response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Operation postApiV3GroupsGroupMembersWithHttpInfo
|
|
|
|
|
|
|
+ * Operation postApiV3GroupsGroupInviteLinksWithHttpInfo
|
|
|
*
|
|
*
|
|
|
- * 加一名成员
|
|
|
|
|
|
|
+ * 签一张团队邀请链接
|
|
|
*
|
|
*
|
|
|
* @param string $group 团队 uid (required)
|
|
* @param string $group 团队 uid (required)
|
|
|
- * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
|
|
|
|
|
- * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
|
|
|
*
|
|
*
|
|
|
* @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
|
|
* @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
|
|
|
* @throws \InvalidArgumentException
|
|
* @throws \InvalidArgumentException
|
|
|
- * @return array of \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
|
|
|
|
|
|
|
+ * @return array of \WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response|\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
|
|
|
*/
|
|
*/
|
|
|
- public function postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
|
|
+ public function postApiV3GroupsGroupInviteLinksWithHttpInfo($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
|
|
|
{
|
|
{
|
|
|
- $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
|
|
|
|
|
|
|
+ $request = $this->postApiV3GroupsGroupInviteLinksRequest($group, $contentType);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
$options = $this->createHttpClientOption();
|
|
$options = $this->createHttpClientOption();
|
|
@@ -3702,13 +3706,13 @@ class GroupsApi
|
|
|
switch($statusCode) {
|
|
switch($statusCode) {
|
|
|
case 200:
|
|
case 200:
|
|
|
return $this->handleResponseWithDataType(
|
|
return $this->handleResponseWithDataType(
|
|
|
- '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
|
|
|
$request,
|
|
$request,
|
|
|
$response,
|
|
$response,
|
|
|
);
|
|
);
|
|
|
case 201:
|
|
case 201:
|
|
|
return $this->handleResponseWithDataType(
|
|
return $this->handleResponseWithDataType(
|
|
|
- '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
|
|
|
$request,
|
|
$request,
|
|
|
$response,
|
|
$response,
|
|
|
);
|
|
);
|
|
@@ -3748,7 +3752,7 @@ class GroupsApi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return $this->handleResponseWithDataType(
|
|
return $this->handleResponseWithDataType(
|
|
|
- '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
|
|
|
$request,
|
|
$request,
|
|
|
$response,
|
|
$response,
|
|
|
);
|
|
);
|
|
@@ -3757,7 +3761,7 @@ class GroupsApi
|
|
|
case 200:
|
|
case 200:
|
|
|
$data = ObjectSerializer::deserialize(
|
|
$data = ObjectSerializer::deserialize(
|
|
|
$e->getResponseBody(),
|
|
$e->getResponseBody(),
|
|
|
- '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
|
|
|
$e->getResponseHeaders()
|
|
$e->getResponseHeaders()
|
|
|
);
|
|
);
|
|
|
$e->setResponseObject($data);
|
|
$e->setResponseObject($data);
|
|
@@ -3765,7 +3769,7 @@ class GroupsApi
|
|
|
case 201:
|
|
case 201:
|
|
|
$data = ObjectSerializer::deserialize(
|
|
$data = ObjectSerializer::deserialize(
|
|
|
$e->getResponseBody(),
|
|
$e->getResponseBody(),
|
|
|
- '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
|
|
|
$e->getResponseHeaders()
|
|
$e->getResponseHeaders()
|
|
|
);
|
|
);
|
|
|
$e->setResponseObject($data);
|
|
$e->setResponseObject($data);
|
|
@@ -3802,20 +3806,19 @@ class GroupsApi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Operation postApiV3GroupsGroupMembersAsync
|
|
|
|
|
|
|
+ * Operation postApiV3GroupsGroupInviteLinksAsync
|
|
|
*
|
|
*
|
|
|
- * 加一名成员
|
|
|
|
|
|
|
+ * 签一张团队邀请链接
|
|
|
*
|
|
*
|
|
|
* @param string $group 团队 uid (required)
|
|
* @param string $group 团队 uid (required)
|
|
|
- * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
|
|
|
|
|
- * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
|
|
|
*
|
|
*
|
|
|
* @throws \InvalidArgumentException
|
|
* @throws \InvalidArgumentException
|
|
|
* @return \GuzzleHttp\Promise\PromiseInterface
|
|
* @return \GuzzleHttp\Promise\PromiseInterface
|
|
|
*/
|
|
*/
|
|
|
- public function postApiV3GroupsGroupMembersAsync($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
|
|
+ public function postApiV3GroupsGroupInviteLinksAsync($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
|
|
|
{
|
|
{
|
|
|
- return $this->postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType)
|
|
|
|
|
|
|
+ return $this->postApiV3GroupsGroupInviteLinksAsyncWithHttpInfo($group, $contentType)
|
|
|
->then(
|
|
->then(
|
|
|
function ($response) {
|
|
function ($response) {
|
|
|
return $response[0];
|
|
return $response[0];
|
|
@@ -3824,21 +3827,20 @@ class GroupsApi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Operation postApiV3GroupsGroupMembersAsyncWithHttpInfo
|
|
|
|
|
|
|
+ * Operation postApiV3GroupsGroupInviteLinksAsyncWithHttpInfo
|
|
|
*
|
|
*
|
|
|
- * 加一名成员
|
|
|
|
|
|
|
+ * 签一张团队邀请链接
|
|
|
*
|
|
*
|
|
|
* @param string $group 团队 uid (required)
|
|
* @param string $group 团队 uid (required)
|
|
|
- * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
|
|
|
|
|
- * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
|
|
|
*
|
|
*
|
|
|
* @throws \InvalidArgumentException
|
|
* @throws \InvalidArgumentException
|
|
|
* @return \GuzzleHttp\Promise\PromiseInterface
|
|
* @return \GuzzleHttp\Promise\PromiseInterface
|
|
|
*/
|
|
*/
|
|
|
- public function postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
|
|
+ public function postApiV3GroupsGroupInviteLinksAsyncWithHttpInfo($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
|
|
|
{
|
|
{
|
|
|
- $returnType = '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response';
|
|
|
|
|
- $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
|
|
|
|
|
|
|
+ $returnType = '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response';
|
|
|
|
|
+ $request = $this->postApiV3GroupsGroupInviteLinksRequest($group, $contentType);
|
|
|
|
|
|
|
|
return $this->client
|
|
return $this->client
|
|
|
->sendAsync($request, $this->createHttpClientOption())
|
|
->sendAsync($request, $this->createHttpClientOption())
|
|
@@ -3877,34 +3879,26 @@ class GroupsApi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Create request for operation 'postApiV3GroupsGroupMembers'
|
|
|
|
|
|
|
+ * Create request for operation 'postApiV3GroupsGroupInviteLinks'
|
|
|
*
|
|
*
|
|
|
* @param string $group 团队 uid (required)
|
|
* @param string $group 团队 uid (required)
|
|
|
- * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
|
|
|
|
|
- * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
|
|
|
*
|
|
*
|
|
|
* @throws \InvalidArgumentException
|
|
* @throws \InvalidArgumentException
|
|
|
* @return \GuzzleHttp\Psr7\Request
|
|
* @return \GuzzleHttp\Psr7\Request
|
|
|
*/
|
|
*/
|
|
|
- public function postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
|
|
+ public function postApiV3GroupsGroupInviteLinksRequest($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
// verify the required parameter 'group' is set
|
|
// verify the required parameter 'group' is set
|
|
|
if ($group === null || (is_array($group) && count($group) === 0)) {
|
|
if ($group === null || (is_array($group) && count($group) === 0)) {
|
|
|
throw new \InvalidArgumentException(
|
|
throw new \InvalidArgumentException(
|
|
|
- 'Missing the required parameter $group when calling postApiV3GroupsGroupMembers'
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // verify the required parameter 'post_api_v3_groups_group_members_request' is set
|
|
|
|
|
- if ($post_api_v3_groups_group_members_request === null || (is_array($post_api_v3_groups_group_members_request) && count($post_api_v3_groups_group_members_request) === 0)) {
|
|
|
|
|
- throw new \InvalidArgumentException(
|
|
|
|
|
- 'Missing the required parameter $post_api_v3_groups_group_members_request when calling postApiV3GroupsGroupMembers'
|
|
|
|
|
|
|
+ 'Missing the required parameter $group when calling postApiV3GroupsGroupInviteLinks'
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- $resourcePath = '/v3/groups/{group}/members';
|
|
|
|
|
|
|
+ $resourcePath = '/v3/groups/{group}/invite-links';
|
|
|
$formParams = [];
|
|
$formParams = [];
|
|
|
$queryParams = [];
|
|
$queryParams = [];
|
|
|
$headerParams = [];
|
|
$headerParams = [];
|
|
@@ -3930,16 +3924,695 @@ class GroupsApi
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
// for model (json/xml)
|
|
// for model (json/xml)
|
|
|
- if (isset($post_api_v3_groups_group_members_request)) {
|
|
|
|
|
- if (stripos($headers['Content-Type'], 'application/json') !== false) {
|
|
|
|
|
- # if Content-Type contains "application/json", json_encode the body
|
|
|
|
|
|
|
+ if (count($formParams) > 0) {
|
|
|
|
|
+ if ($multipart) {
|
|
|
|
|
+ $multipartContents = [];
|
|
|
|
|
+ foreach ($formParams as $formParamName => $formParamValue) {
|
|
|
|
|
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
|
|
|
|
|
+ foreach ($formParamValueItems as $formParamValueItem) {
|
|
|
|
|
+ $multipartContents[] = [
|
|
|
|
|
+ 'name' => $formParamName,
|
|
|
|
|
+ 'contents' => $formParamValueItem
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // for HTTP post (form)
|
|
|
|
|
+ $httpBody = new MultipartStream($multipartContents);
|
|
|
|
|
+
|
|
|
|
|
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
|
|
|
|
|
+ # if Content-Type contains "application/json", json_encode the form parameters
|
|
|
try {
|
|
try {
|
|
|
- $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($post_api_v3_groups_group_members_request), JSON_THROW_ON_ERROR);
|
|
|
|
|
|
|
+ $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
|
|
|
} catch (\JsonException $e) {
|
|
} catch (\JsonException $e) {
|
|
|
throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
|
|
throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- $httpBody = $post_api_v3_groups_group_members_request;
|
|
|
|
|
|
|
+ // for HTTP post (form)
|
|
|
|
|
+ $httpBody = ObjectSerializer::buildQuery($formParams);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // this endpoint requires Bearer authentication (access token)
|
|
|
|
|
+ if (!empty($this->config->getAccessToken())) {
|
|
|
|
|
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $defaultHeaders = [];
|
|
|
|
|
+ if ($this->config->getUserAgent()) {
|
|
|
|
|
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $headers = array_merge(
|
|
|
|
|
+ $defaultHeaders,
|
|
|
|
|
+ $headerParams,
|
|
|
|
|
+ $headers
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ $operationHost = $this->config->getHost();
|
|
|
|
|
+ $query = ObjectSerializer::buildQuery($queryParams);
|
|
|
|
|
+ return new Request(
|
|
|
|
|
+ 'POST',
|
|
|
|
|
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
|
|
|
|
+ $headers,
|
|
|
|
|
+ $httpBody
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Operation postApiV3GroupsGroupMembers
|
|
|
|
|
+ *
|
|
|
|
|
+ * 加一名成员
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param string $group 团队 uid (required)
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request post_api_v3_groups_group_members_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3GroupsGroupMembers($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+ list($response) = $this->postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType);
|
|
|
|
|
+ return $response;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Operation postApiV3GroupsGroupMembersWithHttpInfo
|
|
|
|
|
+ *
|
|
|
|
|
+ * 加一名成员
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param string $group 团队 uid (required)
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return array of \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+ $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ $options = $this->createHttpClientOption();
|
|
|
|
|
+ try {
|
|
|
|
|
+ $response = $this->client->send($request, $options);
|
|
|
|
|
+ } catch (RequestException $e) {
|
|
|
|
|
+ throw new ApiException(
|
|
|
|
|
+ "[{$e->getCode()}] {$e->getMessage()}",
|
|
|
|
|
+ (int) $e->getCode(),
|
|
|
|
|
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
|
|
|
|
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
|
|
|
|
+ );
|
|
|
|
|
+ } catch (ConnectException $e) {
|
|
|
|
|
+ throw new ApiException(
|
|
|
|
|
+ "[{$e->getCode()}] {$e->getMessage()}",
|
|
|
|
|
+ (int) $e->getCode(),
|
|
|
|
|
+ null,
|
|
|
|
|
+ null
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $statusCode = $response->getStatusCode();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ switch($statusCode) {
|
|
|
|
|
+ case 200:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ case 201:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ case 401:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ case 403:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ case 422:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if ($statusCode < 200 || $statusCode > 299) {
|
|
|
|
|
+ throw new ApiException(
|
|
|
|
|
+ sprintf(
|
|
|
|
|
+ '[%d] Error connecting to the API (%s)',
|
|
|
|
|
+ $statusCode,
|
|
|
|
|
+ (string) $request->getUri()
|
|
|
|
|
+ ),
|
|
|
|
|
+ $statusCode,
|
|
|
|
|
+ $response->getHeaders(),
|
|
|
|
|
+ (string) $response->getBody()
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ } catch (ApiException $e) {
|
|
|
|
|
+ switch ($e->getCode()) {
|
|
|
|
|
+ case 200:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ case 201:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ case 401:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ case 403:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ case 422:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Operation postApiV3GroupsGroupMembersAsync
|
|
|
|
|
+ *
|
|
|
|
|
+ * 加一名成员
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param string $group 团队 uid (required)
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return \GuzzleHttp\Promise\PromiseInterface
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3GroupsGroupMembersAsync($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType)
|
|
|
|
|
+ ->then(
|
|
|
|
|
+ function ($response) {
|
|
|
|
|
+ return $response[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Operation postApiV3GroupsGroupMembersAsyncWithHttpInfo
|
|
|
|
|
+ *
|
|
|
|
|
+ * 加一名成员
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param string $group 团队 uid (required)
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return \GuzzleHttp\Promise\PromiseInterface
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+ $returnType = '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response';
|
|
|
|
|
+ $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
|
|
|
|
|
+
|
|
|
|
|
+ return $this->client
|
|
|
|
|
+ ->sendAsync($request, $this->createHttpClientOption())
|
|
|
|
|
+ ->then(
|
|
|
|
|
+ function ($response) use ($returnType) {
|
|
|
|
|
+ if ($returnType === '\SplFileObject') {
|
|
|
|
|
+ $content = $response->getBody(); //stream goes to serializer
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $content = (string) $response->getBody();
|
|
|
|
|
+ if ($returnType !== 'string') {
|
|
|
|
|
+ $content = json_decode($content);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return [
|
|
|
|
|
+ ObjectSerializer::deserialize($content, $returnType, []),
|
|
|
|
|
+ $response->getStatusCode(),
|
|
|
|
|
+ $response->getHeaders()
|
|
|
|
|
+ ];
|
|
|
|
|
+ },
|
|
|
|
|
+ function ($exception) {
|
|
|
|
|
+ $response = $exception->getResponse();
|
|
|
|
|
+ $statusCode = $response->getStatusCode();
|
|
|
|
|
+ throw new ApiException(
|
|
|
|
|
+ sprintf(
|
|
|
|
|
+ '[%d] Error connecting to the API (%s)',
|
|
|
|
|
+ $statusCode,
|
|
|
|
|
+ $exception->getRequest()->getUri()
|
|
|
|
|
+ ),
|
|
|
|
|
+ $statusCode,
|
|
|
|
|
+ $response->getHeaders(),
|
|
|
|
|
+ (string) $response->getBody()
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Create request for operation 'postApiV3GroupsGroupMembers'
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param string $group 团队 uid (required)
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return \GuzzleHttp\Psr7\Request
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ // verify the required parameter 'group' is set
|
|
|
|
|
+ if ($group === null || (is_array($group) && count($group) === 0)) {
|
|
|
|
|
+ throw new \InvalidArgumentException(
|
|
|
|
|
+ 'Missing the required parameter $group when calling postApiV3GroupsGroupMembers'
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // verify the required parameter 'post_api_v3_groups_group_members_request' is set
|
|
|
|
|
+ if ($post_api_v3_groups_group_members_request === null || (is_array($post_api_v3_groups_group_members_request) && count($post_api_v3_groups_group_members_request) === 0)) {
|
|
|
|
|
+ throw new \InvalidArgumentException(
|
|
|
|
|
+ 'Missing the required parameter $post_api_v3_groups_group_members_request when calling postApiV3GroupsGroupMembers'
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $resourcePath = '/v3/groups/{group}/members';
|
|
|
|
|
+ $formParams = [];
|
|
|
|
|
+ $queryParams = [];
|
|
|
|
|
+ $headerParams = [];
|
|
|
|
|
+ $httpBody = '';
|
|
|
|
|
+ $multipart = false;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // path params
|
|
|
|
|
+ if ($group !== null) {
|
|
|
|
|
+ $resourcePath = str_replace(
|
|
|
|
|
+ '{group}',
|
|
|
|
|
+ ObjectSerializer::toPathValue($group),
|
|
|
|
|
+ $resourcePath
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $headers = $this->headerSelector->selectHeaders(
|
|
|
|
|
+ ['application/json', 'application/problem+json', ],
|
|
|
|
|
+ $contentType,
|
|
|
|
|
+ $multipart
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ // for model (json/xml)
|
|
|
|
|
+ if (isset($post_api_v3_groups_group_members_request)) {
|
|
|
|
|
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
|
|
|
|
|
+ # if Content-Type contains "application/json", json_encode the body
|
|
|
|
|
+ try {
|
|
|
|
|
+ $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($post_api_v3_groups_group_members_request), JSON_THROW_ON_ERROR);
|
|
|
|
|
+ } catch (\JsonException $e) {
|
|
|
|
|
+ throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $httpBody = $post_api_v3_groups_group_members_request;
|
|
|
|
|
+ }
|
|
|
|
|
+ } elseif (count($formParams) > 0) {
|
|
|
|
|
+ if ($multipart) {
|
|
|
|
|
+ $multipartContents = [];
|
|
|
|
|
+ foreach ($formParams as $formParamName => $formParamValue) {
|
|
|
|
|
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
|
|
|
|
|
+ foreach ($formParamValueItems as $formParamValueItem) {
|
|
|
|
|
+ $multipartContents[] = [
|
|
|
|
|
+ 'name' => $formParamName,
|
|
|
|
|
+ 'contents' => $formParamValueItem
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // for HTTP post (form)
|
|
|
|
|
+ $httpBody = new MultipartStream($multipartContents);
|
|
|
|
|
+
|
|
|
|
|
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
|
|
|
|
|
+ # if Content-Type contains "application/json", json_encode the form parameters
|
|
|
|
|
+ try {
|
|
|
|
|
+ $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
|
|
|
|
|
+ } catch (\JsonException $e) {
|
|
|
|
|
+ throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // for HTTP post (form)
|
|
|
|
|
+ $httpBody = ObjectSerializer::buildQuery($formParams);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // this endpoint requires Bearer authentication (access token)
|
|
|
|
|
+ if (!empty($this->config->getAccessToken())) {
|
|
|
|
|
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $defaultHeaders = [];
|
|
|
|
|
+ if ($this->config->getUserAgent()) {
|
|
|
|
|
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $headers = array_merge(
|
|
|
|
|
+ $defaultHeaders,
|
|
|
|
|
+ $headerParams,
|
|
|
|
|
+ $headers
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ $operationHost = $this->config->getHost();
|
|
|
|
|
+ $query = ObjectSerializer::buildQuery($queryParams);
|
|
|
|
|
+ return new Request(
|
|
|
|
|
+ 'POST',
|
|
|
|
|
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
|
|
|
|
+ $headers,
|
|
|
|
|
+ $httpBody
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Operation postApiV3MeGroups
|
|
|
|
|
+ *
|
|
|
|
|
+ * 凭邀请链接加入团队
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request post_api_v3_me_groups_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return \WikipaliApi\Model\PostApiV3MeGroups200Response|\WikipaliApi\Model\PostApiV3MeGroups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3MeGroups($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+ list($response) = $this->postApiV3MeGroupsWithHttpInfo($post_api_v3_me_groups_request, $contentType);
|
|
|
|
|
+ return $response;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Operation postApiV3MeGroupsWithHttpInfo
|
|
|
|
|
+ *
|
|
|
|
|
+ * 凭邀请链接加入团队
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return array of \WikipaliApi\Model\PostApiV3MeGroups200Response|\WikipaliApi\Model\PostApiV3MeGroups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3MeGroupsWithHttpInfo($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+ $request = $this->postApiV3MeGroupsRequest($post_api_v3_me_groups_request, $contentType);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ $options = $this->createHttpClientOption();
|
|
|
|
|
+ try {
|
|
|
|
|
+ $response = $this->client->send($request, $options);
|
|
|
|
|
+ } catch (RequestException $e) {
|
|
|
|
|
+ throw new ApiException(
|
|
|
|
|
+ "[{$e->getCode()}] {$e->getMessage()}",
|
|
|
|
|
+ (int) $e->getCode(),
|
|
|
|
|
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
|
|
|
|
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
|
|
|
|
+ );
|
|
|
|
|
+ } catch (ConnectException $e) {
|
|
|
|
|
+ throw new ApiException(
|
|
|
|
|
+ "[{$e->getCode()}] {$e->getMessage()}",
|
|
|
|
|
+ (int) $e->getCode(),
|
|
|
|
|
+ null,
|
|
|
|
|
+ null
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $statusCode = $response->getStatusCode();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ switch($statusCode) {
|
|
|
|
|
+ case 200:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3MeGroups200Response',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ case 201:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3MeGroups200Response',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ case 401:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ case 403:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ case 422:
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if ($statusCode < 200 || $statusCode > 299) {
|
|
|
|
|
+ throw new ApiException(
|
|
|
|
|
+ sprintf(
|
|
|
|
|
+ '[%d] Error connecting to the API (%s)',
|
|
|
|
|
+ $statusCode,
|
|
|
|
|
+ (string) $request->getUri()
|
|
|
|
|
+ ),
|
|
|
|
|
+ $statusCode,
|
|
|
|
|
+ $response->getHeaders(),
|
|
|
|
|
+ (string) $response->getBody()
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return $this->handleResponseWithDataType(
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3MeGroups200Response',
|
|
|
|
|
+ $request,
|
|
|
|
|
+ $response,
|
|
|
|
|
+ );
|
|
|
|
|
+ } catch (ApiException $e) {
|
|
|
|
|
+ switch ($e->getCode()) {
|
|
|
|
|
+ case 200:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3MeGroups200Response',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ case 201:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\PostApiV3MeGroups200Response',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ case 401:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ case 403:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ case 422:
|
|
|
|
|
+ $data = ObjectSerializer::deserialize(
|
|
|
|
|
+ $e->getResponseBody(),
|
|
|
|
|
+ '\WikipaliApi\Model\ProblemDetails',
|
|
|
|
|
+ $e->getResponseHeaders()
|
|
|
|
|
+ );
|
|
|
|
|
+ $e->setResponseObject($data);
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ throw $e;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Operation postApiV3MeGroupsAsync
|
|
|
|
|
+ *
|
|
|
|
|
+ * 凭邀请链接加入团队
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return \GuzzleHttp\Promise\PromiseInterface
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3MeGroupsAsync($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->postApiV3MeGroupsAsyncWithHttpInfo($post_api_v3_me_groups_request, $contentType)
|
|
|
|
|
+ ->then(
|
|
|
|
|
+ function ($response) {
|
|
|
|
|
+ return $response[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Operation postApiV3MeGroupsAsyncWithHttpInfo
|
|
|
|
|
+ *
|
|
|
|
|
+ * 凭邀请链接加入团队
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return \GuzzleHttp\Promise\PromiseInterface
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3MeGroupsAsyncWithHttpInfo($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+ $returnType = '\WikipaliApi\Model\PostApiV3MeGroups200Response';
|
|
|
|
|
+ $request = $this->postApiV3MeGroupsRequest($post_api_v3_me_groups_request, $contentType);
|
|
|
|
|
+
|
|
|
|
|
+ return $this->client
|
|
|
|
|
+ ->sendAsync($request, $this->createHttpClientOption())
|
|
|
|
|
+ ->then(
|
|
|
|
|
+ function ($response) use ($returnType) {
|
|
|
|
|
+ if ($returnType === '\SplFileObject') {
|
|
|
|
|
+ $content = $response->getBody(); //stream goes to serializer
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $content = (string) $response->getBody();
|
|
|
|
|
+ if ($returnType !== 'string') {
|
|
|
|
|
+ $content = json_decode($content);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return [
|
|
|
|
|
+ ObjectSerializer::deserialize($content, $returnType, []),
|
|
|
|
|
+ $response->getStatusCode(),
|
|
|
|
|
+ $response->getHeaders()
|
|
|
|
|
+ ];
|
|
|
|
|
+ },
|
|
|
|
|
+ function ($exception) {
|
|
|
|
|
+ $response = $exception->getResponse();
|
|
|
|
|
+ $statusCode = $response->getStatusCode();
|
|
|
|
|
+ throw new ApiException(
|
|
|
|
|
+ sprintf(
|
|
|
|
|
+ '[%d] Error connecting to the API (%s)',
|
|
|
|
|
+ $statusCode,
|
|
|
|
|
+ $exception->getRequest()->getUri()
|
|
|
|
|
+ ),
|
|
|
|
|
+ $statusCode,
|
|
|
|
|
+ $response->getHeaders(),
|
|
|
|
|
+ (string) $response->getBody()
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Create request for operation 'postApiV3MeGroups'
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request (required)
|
|
|
|
|
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \InvalidArgumentException
|
|
|
|
|
+ * @return \GuzzleHttp\Psr7\Request
|
|
|
|
|
+ */
|
|
|
|
|
+ public function postApiV3MeGroupsRequest($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ // verify the required parameter 'post_api_v3_me_groups_request' is set
|
|
|
|
|
+ if ($post_api_v3_me_groups_request === null || (is_array($post_api_v3_me_groups_request) && count($post_api_v3_me_groups_request) === 0)) {
|
|
|
|
|
+ throw new \InvalidArgumentException(
|
|
|
|
|
+ 'Missing the required parameter $post_api_v3_me_groups_request when calling postApiV3MeGroups'
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $resourcePath = '/v3/me/groups';
|
|
|
|
|
+ $formParams = [];
|
|
|
|
|
+ $queryParams = [];
|
|
|
|
|
+ $headerParams = [];
|
|
|
|
|
+ $httpBody = '';
|
|
|
|
|
+ $multipart = false;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $headers = $this->headerSelector->selectHeaders(
|
|
|
|
|
+ ['application/json', 'application/problem+json', ],
|
|
|
|
|
+ $contentType,
|
|
|
|
|
+ $multipart
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ // for model (json/xml)
|
|
|
|
|
+ if (isset($post_api_v3_me_groups_request)) {
|
|
|
|
|
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
|
|
|
|
|
+ # if Content-Type contains "application/json", json_encode the body
|
|
|
|
|
+ try {
|
|
|
|
|
+ $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($post_api_v3_me_groups_request), JSON_THROW_ON_ERROR);
|
|
|
|
|
+ } catch (\JsonException $e) {
|
|
|
|
|
+ throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $httpBody = $post_api_v3_me_groups_request;
|
|
|
}
|
|
}
|
|
|
} elseif (count($formParams) > 0) {
|
|
} elseif (count($formParams) > 0) {
|
|
|
if ($multipart) {
|
|
if ($multipart) {
|