
com.tencentcloudapi.gse.v20191112.GseClient Maven / Gradle / Ivy
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.gse.v20191112;
import java.lang.reflect.Type;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.AbstractClient;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.JsonResponseModel;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.gse.v20191112.models.*;
public class GseClient extends AbstractClient{
private static String endpoint = "gse.tencentcloudapi.com";
private static String version = "2019-11-12";
public GseClient(Credential credential, String region) {
this(credential, region, new ClientProfile());
}
public GseClient(Credential credential, String region, ClientProfile profile) {
super(GseClient.endpoint, GseClient.version, credential, region, profile);
}
/**
*本接口(CreateGameServerSession)用于创建游戏服务会话
* @param req CreateGameServerSessionRequest
* @return CreateGameServerSessionResponse
* @throws TencentCloudSDKException
*/
public CreateGameServerSessionResponse CreateGameServerSession(CreateGameServerSessionRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "CreateGameServerSession"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*用于删除扩缩容配置
* @param req DeleteScalingPolicyRequest
* @return DeleteScalingPolicyResponse
* @throws TencentCloudSDKException
*/
public DeleteScalingPolicyResponse DeleteScalingPolicy(DeleteScalingPolicyRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "DeleteScalingPolicy"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*用于查询服务部署容量配置
* @param req DescribeFleetCapacityRequest
* @return DescribeFleetCapacityResponse
* @throws TencentCloudSDKException
*/
public DescribeFleetCapacityResponse DescribeFleetCapacity(DescribeFleetCapacityRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "DescribeFleetCapacity"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(DescribeGameServerSessionDetails)用于查询游戏服务器会话详情列表
* @param req DescribeGameServerSessionDetailsRequest
* @return DescribeGameServerSessionDetailsResponse
* @throws TencentCloudSDKException
*/
public DescribeGameServerSessionDetailsResponse DescribeGameServerSessionDetails(DescribeGameServerSessionDetailsRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "DescribeGameServerSessionDetails"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(DescribeGameServerSessionPlacement)用于查询游戏服务器会话的放置
* @param req DescribeGameServerSessionPlacementRequest
* @return DescribeGameServerSessionPlacementResponse
* @throws TencentCloudSDKException
*/
public DescribeGameServerSessionPlacementResponse DescribeGameServerSessionPlacement(DescribeGameServerSessionPlacementRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "DescribeGameServerSessionPlacement"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(DescribeGameServerSessions)用于查询游戏服务器会话列表
* @param req DescribeGameServerSessionsRequest
* @return DescribeGameServerSessionsResponse
* @throws TencentCloudSDKException
*/
public DescribeGameServerSessionsResponse DescribeGameServerSessions(DescribeGameServerSessionsRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "DescribeGameServerSessions"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(DescribePlayerSessions)用于获取玩家会话列表
* @param req DescribePlayerSessionsRequest
* @return DescribePlayerSessionsResponse
* @throws TencentCloudSDKException
*/
public DescribePlayerSessionsResponse DescribePlayerSessions(DescribePlayerSessionsRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "DescribePlayerSessions"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*用于查询服务部署的动态扩缩容配置
* @param req DescribeScalingPoliciesRequest
* @return DescribeScalingPoliciesResponse
* @throws TencentCloudSDKException
*/
public DescribeScalingPoliciesResponse DescribeScalingPolicies(DescribeScalingPoliciesRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "DescribeScalingPolicies"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(GetGameServerSessionLogUrl)用于获取游戏服务器会话的日志URL
* @param req GetGameServerSessionLogUrlRequest
* @return GetGameServerSessionLogUrlResponse
* @throws TencentCloudSDKException
*/
public GetGameServerSessionLogUrlResponse GetGameServerSessionLogUrl(GetGameServerSessionLogUrlRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "GetGameServerSessionLogUrl"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(JoinGameServerSession)用于加入游戏服务器会话
* @param req JoinGameServerSessionRequest
* @return JoinGameServerSessionResponse
* @throws TencentCloudSDKException
*/
public JoinGameServerSessionResponse JoinGameServerSession(JoinGameServerSessionRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "JoinGameServerSession"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*用于设置动态扩缩容配置
* @param req PutScalingPolicyRequest
* @return PutScalingPolicyResponse
* @throws TencentCloudSDKException
*/
public PutScalingPolicyResponse PutScalingPolicy(PutScalingPolicyRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "PutScalingPolicy"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(StartGameServerSessionPlacement)用于开始放置游戏服务器会话
* @param req StartGameServerSessionPlacementRequest
* @return StartGameServerSessionPlacementResponse
* @throws TencentCloudSDKException
*/
public StartGameServerSessionPlacementResponse StartGameServerSessionPlacement(StartGameServerSessionPlacementRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "StartGameServerSessionPlacement"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(StopGameServerSessionPlacement)用于停止放置游戏服务器会话
* @param req StopGameServerSessionPlacementRequest
* @return StopGameServerSessionPlacementResponse
* @throws TencentCloudSDKException
*/
public StopGameServerSessionPlacementResponse StopGameServerSessionPlacement(StopGameServerSessionPlacementRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "StopGameServerSessionPlacement"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*用于更新服务部署容量配置
* @param req UpdateFleetCapacityRequest
* @return UpdateFleetCapacityResponse
* @throws TencentCloudSDKException
*/
public UpdateFleetCapacityResponse UpdateFleetCapacity(UpdateFleetCapacityRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "UpdateFleetCapacity"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
/**
*本接口(UpdateGameServerSession)用于更新游戏服务器会话
* @param req UpdateGameServerSessionRequest
* @return UpdateGameServerSessionResponse
* @throws TencentCloudSDKException
*/
public UpdateGameServerSessionResponse UpdateGameServerSession(UpdateGameServerSessionRequest req) throws TencentCloudSDKException{
JsonResponseModel rsp = null;
try {
Type type = new TypeToken>() {
}.getType();
rsp = gson.fromJson(this.internalRequest(req, "UpdateGameServerSession"), type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException(e.getMessage());
}
return rsp.response;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy