Add video compose api.

This commit is contained in:
sdk-team
2020-07-08 17:39:55 +08:00
parent 53ce2f6947
commit 7959141d87
9 changed files with 70 additions and 48 deletions

View File

@@ -39,27 +39,27 @@ namespace AlibabaCloud
void setCorpId(const std::string& corpId);
std::string getDomainName()const;
void setDomainName(const std::string& domainName);
std::string getPicUrlList()const;
void setPicUrlList(const std::string& picUrlList);
std::string getAudioUrl()const;
void setAudioUrl(const std::string& audioUrl);
int getVideoFrameRate()const;
void setVideoFrameRate(int videoFrameRate);
std::string getImageFileNames()const;
void setImageFileNames(const std::string& imageFileNames);
std::string getAudioFileName()const;
void setAudioFileName(const std::string& audioFileName);
std::string getBucketName()const;
void setBucketName(const std::string& bucketName);
std::string getImageParameters()const;
void setImageParameters(const std::string& imageParameters);
std::string getVideoRate()const;
void setVideoRate(const std::string& videoRate);
std::string getVideoFormat()const;
void setVideoFormat(const std::string& videoFormat);
private:
std::string corpId_;
std::string domainName_;
std::string picUrlList_;
std::string audioUrl_;
int videoFrameRate_;
std::string imageFileNames_;
std::string audioFileName_;
std::string bucketName_;
std::string imageParameters_;
std::string videoRate_;
std::string videoFormat_;
};

View File

@@ -32,25 +32,22 @@ namespace AlibabaCloud
class ALIBABACLOUD_VCS_EXPORT CreateVideoComposeTaskResult : public ServiceResult
{
public:
struct Data
{
int bucketName;
int domainName;
};
CreateVideoComposeTaskResult();
explicit CreateVideoComposeTaskResult(const std::string &payload);
~CreateVideoComposeTaskResult();
std::string getBucketName()const;
std::string getMessage()const;
Data getData()const;
std::string getDomainName()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string bucketName_;
std::string message_;
Data data_;
std::string domainName_;
std::string code_;
};

View File

@@ -37,13 +37,17 @@ namespace AlibabaCloud
GetVideoComposeResultResult();
explicit GetVideoComposeResultResult(const std::string &payload);
~GetVideoComposeResultResult();
std::string getStatus()const;
std::string getMessage()const;
std::string getCode()const;
std::string getVideoUrl()const;
protected:
void parse(const std::string &payload);
private:
std::string status_;
std::string message_;
std::string code_;
std::string videoUrl_;
};

View File

@@ -31,21 +31,21 @@ VcsClient::VcsClient(const Credentials &credentials, const ClientConfiguration &
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "vcs");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
VcsClient::VcsClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "vcs");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
VcsClient::VcsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "vcs");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
VcsClient::~VcsClient()

View File

@@ -49,26 +49,37 @@ void CreateVideoComposeTaskRequest::setDomainName(const std::string& domainName)
setBodyParameter("DomainName", domainName);
}
std::string CreateVideoComposeTaskRequest::getPicUrlList()const
int CreateVideoComposeTaskRequest::getVideoFrameRate()const
{
return picUrlList_;
return videoFrameRate_;
}
void CreateVideoComposeTaskRequest::setPicUrlList(const std::string& picUrlList)
void CreateVideoComposeTaskRequest::setVideoFrameRate(int videoFrameRate)
{
picUrlList_ = picUrlList;
setBodyParameter("PicUrlList", picUrlList);
videoFrameRate_ = videoFrameRate;
setBodyParameter("VideoFrameRate", std::to_string(videoFrameRate));
}
std::string CreateVideoComposeTaskRequest::getAudioUrl()const
std::string CreateVideoComposeTaskRequest::getImageFileNames()const
{
return audioUrl_;
return imageFileNames_;
}
void CreateVideoComposeTaskRequest::setAudioUrl(const std::string& audioUrl)
void CreateVideoComposeTaskRequest::setImageFileNames(const std::string& imageFileNames)
{
audioUrl_ = audioUrl;
setBodyParameter("AudioUrl", audioUrl);
imageFileNames_ = imageFileNames;
setBodyParameter("ImageFileNames", imageFileNames);
}
std::string CreateVideoComposeTaskRequest::getAudioFileName()const
{
return audioFileName_;
}
void CreateVideoComposeTaskRequest::setAudioFileName(const std::string& audioFileName)
{
audioFileName_ = audioFileName;
setBodyParameter("AudioFileName", audioFileName);
}
std::string CreateVideoComposeTaskRequest::getBucketName()const
@@ -93,17 +104,6 @@ void CreateVideoComposeTaskRequest::setImageParameters(const std::string& imageP
setBodyParameter("ImageParameters", imageParameters);
}
std::string CreateVideoComposeTaskRequest::getVideoRate()const
{
return videoRate_;
}
void CreateVideoComposeTaskRequest::setVideoRate(const std::string& videoRate)
{
videoRate_ = videoRate;
setBodyParameter("VideoRate", videoRate);
}
std::string CreateVideoComposeTaskRequest::getVideoFormat()const
{
return videoFormat_;

View File

@@ -39,26 +39,30 @@ void CreateVideoComposeTaskResult::parse(const std::string &payload)
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["DomainName"].isNull())
data_.domainName = std::stoi(dataNode["DomainName"].asString());
if(!dataNode["BucketName"].isNull())
data_.bucketName = std::stoi(dataNode["BucketName"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["DomainName"].isNull())
domainName_ = value["DomainName"].asString();
if(!value["BucketName"].isNull())
bucketName_ = value["BucketName"].asString();
}
std::string CreateVideoComposeTaskResult::getBucketName()const
{
return bucketName_;
}
std::string CreateVideoComposeTaskResult::getMessage()const
{
return message_;
}
CreateVideoComposeTaskResult::Data CreateVideoComposeTaskResult::getData()const
std::string CreateVideoComposeTaskResult::getDomainName()const
{
return data_;
return domainName_;
}
std::string CreateVideoComposeTaskResult::getCode()const

View File

@@ -43,14 +43,28 @@ void GetVideoComposeResultResult::parse(const std::string &payload)
message_ = value["Message"].asString();
if(!value["VideoUrl"].isNull())
videoUrl_ = value["VideoUrl"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Status"].isNull())
status_ = value["Status"].asString();
}
std::string GetVideoComposeResultResult::getStatus()const
{
return status_;
}
std::string GetVideoComposeResultResult::getMessage()const
{
return message_;
}
std::string GetVideoComposeResultResult::getCode()const
{
return code_;
}
std::string GetVideoComposeResultResult::getVideoUrl()const
{
return videoUrl_;