net.accelbyte.sdk.api.dsmc.operations.deployment_config.CreateDeploymentOverride Maven / Gradle / Ivy
Show all versions of module-dsmc Show documentation
/*
* Copyright (c) 2024 AccelByte Inc. All Rights Reserved
* This is licensed software from AccelByte Inc, for limitations
* and restrictions contact your company contract manager.
*
* Code generated. DO NOT EDIT.
*/
package net.accelbyte.sdk.api.dsmc.operations.deployment_config;
import java.io.*;
import java.util.*;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import net.accelbyte.sdk.api.dsmc.models.*;
import net.accelbyte.sdk.core.HttpResponseException;
import net.accelbyte.sdk.core.Operation;
import net.accelbyte.sdk.core.util.Helper;
/**
* CreateDeploymentOverride
*
* Required permission: ADMIN:NAMESPACE:{namespace}:DSM:CONFIG [CREATE]
*
*
Required scope: social
*
*
This endpoint create a dedicated servers deployment override in a namespace.
*/
@Getter
@Setter
public class CreateDeploymentOverride extends Operation {
/** generated field's value */
private String path =
"/dsmcontroller/admin/namespaces/{namespace}/configs/deployments/{deployment}/overrides/version/{version}";
private String method = "POST";
private List consumes = Arrays.asList("application/json");
private List produces = Arrays.asList("application/json");
private String locationQuery = null;
/** fields as input parameter */
private String deployment;
private String namespace;
private String version;
private ModelsCreateDeploymentOverrideRequest body;
/**
* @param deployment required
* @param namespace required
* @param version required
* @param body required
*/
@Builder
// @deprecated 2022-08-29 - All args constructor may cause problems. Use builder instead.
@Deprecated
public CreateDeploymentOverride(
String customBasePath,
String deployment,
String namespace,
String version,
ModelsCreateDeploymentOverrideRequest body) {
this.deployment = deployment;
this.namespace = namespace;
this.version = version;
this.body = body;
super.customBasePath = customBasePath != null ? customBasePath : "";
securities.add("Bearer");
}
@Override
public Map getPathParams() {
Map pathParams = new HashMap<>();
if (this.deployment != null) {
pathParams.put("deployment", this.deployment);
}
if (this.namespace != null) {
pathParams.put("namespace", this.namespace);
}
if (this.version != null) {
pathParams.put("version", this.version);
}
return pathParams;
}
@Override
public ModelsCreateDeploymentOverrideRequest getBodyParams() {
return this.body;
}
@Override
public boolean isValid() {
if (this.deployment == null) {
return false;
}
if (this.namespace == null) {
return false;
}
if (this.version == null) {
return false;
}
return true;
}
public ModelsDeploymentWithOverride parseResponse(
int code, String contentType, InputStream payload) throws HttpResponseException, IOException {
if (code != 201) {
final String json = Helper.convertInputStreamToString(payload);
throw new HttpResponseException(code, json);
}
final String json = Helper.convertInputStreamToString(payload);
return new ModelsDeploymentWithOverride().createFromJson(json);
}
}