public class SdkCommon
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getProjectName()
Returns the SDK project's name.
|
static java.util.Map<java.lang.String,java.lang.String> |
getSdkHeaders(java.lang.String serviceName,
java.lang.String serviceVersion,
java.lang.String operationId)
This function is invoked by generated service methods (i.e.
|
static java.lang.String |
getVersion()
Returns the SDK project's version.
|
protected static void |
readBuildProperties() |
public static java.lang.String getVersion()
public static java.lang.String getProjectName()
protected static void readBuildProperties()
public static java.util.Map<java.lang.String,java.lang.String> getSdkHeaders(java.lang.String serviceName, java.lang.String serviceVersion, java.lang.String operationId)
This function is invoked for each invocation of a generated service method, so the set of HTTP headers could be request-specific. As an optimization, if your SDK will be returning the same set of HTTP headers for each invocation of this function, it is recommended that you initialize the returned map just once (perhaps by using lazy initialization) and simply return it each time the function is invoked, instead of building it each time as in the example below.
serviceName
- the name of the service as defined in the API definition (e.g. "objectstorage")serviceVersion
- the version of the service as defined in the API definition (e.g. "V1")operationId
- the operationId as defined in the API definition (e.g. getContext)Copyright © 2025. All rights reserved.