Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GCSJARDSAPIClient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jards
GCSJARDSAPIClient
Commits
961a06c2
Commit
961a06c2
authored
7 years ago
by
Carsten Karbach
Browse files
Options
Downloads
Patches
Plain Diff
Update generated code with POST function
parent
8cd17ed3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Api/FilesApi.php
+112
-0
112 additions, 0 deletions
lib/Api/FilesApi.php
with
112 additions
and
0 deletions
lib/Api/FilesApi.php
+
112
−
0
View file @
961a06c2
...
...
@@ -183,6 +183,118 @@ class FilesApi
}
}
/**
* Operation filesAppidFilePost
*
* @param int $appid ID of the application. (required)
* @param string $file Name of requested file. (required)
* @param \SplFileObject $fileupload The PDF file to upload. (required)
* @throws \jards\gcsjardsapiclient\Swagger\Client\ApiException on non-2xx response
* @return string
*/
public
function
filesAppidFilePost
(
$appid
,
$file
,
$fileupload
)
{
list
(
$response
)
=
$this
->
filesAppidFilePostWithHttpInfo
(
$appid
,
$file
,
$fileupload
);
return
$response
;
}
/**
* Operation filesAppidFilePostWithHttpInfo
*
* @param int $appid ID of the application. (required)
* @param string $file Name of requested file. (required)
* @param \SplFileObject $fileupload The PDF file to upload. (required)
* @throws \jards\gcsjardsapiclient\Swagger\Client\ApiException on non-2xx response
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public
function
filesAppidFilePostWithHttpInfo
(
$appid
,
$file
,
$fileupload
)
{
// verify the required parameter 'appid' is set
if
(
$appid
===
null
)
{
throw
new
\InvalidArgumentException
(
'Missing the required parameter $appid when calling filesAppidFilePost'
);
}
// verify the required parameter 'file' is set
if
(
$file
===
null
)
{
throw
new
\InvalidArgumentException
(
'Missing the required parameter $file when calling filesAppidFilePost'
);
}
// verify the required parameter 'fileupload' is set
if
(
$fileupload
===
null
)
{
throw
new
\InvalidArgumentException
(
'Missing the required parameter $fileupload when calling filesAppidFilePost'
);
}
// parse inputs
$resourcePath
=
"/files/
{
appid}/{file
}
"
;
$httpBody
=
''
;
$queryParams
=
[];
$headerParams
=
[];
$formParams
=
[];
$_header_accept
=
$this
->
apiClient
->
selectHeaderAccept
([
'application/json'
]);
if
(
!
is_null
(
$_header_accept
))
{
$headerParams
[
'Accept'
]
=
$_header_accept
;
}
$headerParams
[
'Content-Type'
]
=
$this
->
apiClient
->
selectHeaderContentType
([
'multipart/form-data'
]);
// path params
if
(
$appid
!==
null
)
{
$resourcePath
=
str_replace
(
"{"
.
"appid"
.
"}"
,
$this
->
apiClient
->
getSerializer
()
->
toPathValue
(
$appid
),
$resourcePath
);
}
// path params
if
(
$file
!==
null
)
{
$resourcePath
=
str_replace
(
"{"
.
"file"
.
"}"
,
$this
->
apiClient
->
getSerializer
()
->
toPathValue
(
$file
),
$resourcePath
);
}
// form params
if
(
$fileupload
!==
null
)
{
// PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
// See: https://wiki.php.net/rfc/curl-file-upload
if
(
function_exists
(
'curl_file_create'
))
{
$formParams
[
'fileupload'
]
=
curl_file_create
(
$this
->
apiClient
->
getSerializer
()
->
toFormValue
(
$fileupload
));
}
else
{
$formParams
[
'fileupload'
]
=
'@'
.
$this
->
apiClient
->
getSerializer
()
->
toFormValue
(
$fileupload
);
}
}
// for model (json/xml)
if
(
isset
(
$_tempBody
))
{
$httpBody
=
$_tempBody
;
// $_tempBody is the method argument, if present
}
elseif
(
count
(
$formParams
)
>
0
)
{
$httpBody
=
$formParams
;
// for HTTP post (form)
}
// make the API Call
try
{
list
(
$response
,
$statusCode
,
$httpHeader
)
=
$this
->
apiClient
->
callApi
(
$resourcePath
,
'POST'
,
$queryParams
,
$httpBody
,
$headerParams
,
'string'
,
'/files/{appid}/{file}'
);
return
[
$this
->
apiClient
->
getSerializer
()
->
deserialize
(
$response
,
'string'
,
$httpHeader
),
$statusCode
,
$httpHeader
];
}
catch
(
ApiException
$e
)
{
switch
(
$e
->
getCode
())
{
case
200
:
$data
=
$this
->
apiClient
->
getSerializer
()
->
deserialize
(
$e
->
getResponseBody
(),
'string'
,
$e
->
getResponseHeaders
());
$e
->
setResponseObject
(
$data
);
break
;
case
404
:
$data
=
$this
->
apiClient
->
getSerializer
()
->
deserialize
(
$e
->
getResponseBody
(),
'string'
,
$e
->
getResponseHeaders
());
$e
->
setResponseObject
(
$data
);
break
;
}
throw
$e
;
}
}
/**
* Operation filesAppidGet
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment