Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The IBM Cloud Platform Services Java SDK allows developers to programmatically i

Service Name | Artifact Coordinates
--- | ---
[Account Management](https://test.cloud.ibm.com/apidocs/account-management) | com.ibm.cloud:account-management:0.73.2
[Case Management](https://cloud.ibm.com/apidocs/case-management?code=java) | com.ibm.cloud:case-management:0.73.2
[Catalog Management](https://cloud.ibm.com/apidocs/resource-catalog/private-catalog?code=java) | com.ibm.cloud:catalog-management:0.73.2
[Context Based Restrictions](https://cloud.ibm.com/apidocs/context-based-restrictions?code=java) | com.ibm.cloud:context-based-restrictions:0.73.2
Expand Down
54 changes: 54 additions & 0 deletions modules/account-management/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<!-- >>> Replace this with the parent pom's artifactId -->
<artifactId>platform-services</artifactId>
<groupId>com.ibm.cloud</groupId>
<version>99-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>

<!-- >>> Replace this with the service module's artifactId (e.g. "example-service") -->
<artifactId>account-management</artifactId>

<!-- >>> Replace this with a text description of this module (e.g. "Example Service") -->
<name>IBM Cloud Account Management API</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.ibm.cloud</groupId>
<artifactId>sdk-core</artifactId>
</dependency>
<dependency>
<!-- >>> Replace this with the "common" module's artifactId (e.g. my-services-common) -->
<artifactId>platform-services-common</artifactId>
<groupId>com.ibm.cloud</groupId>
</dependency>
<dependency>
<!-- >>> Replace this with the "common" module's artifactId (e.g. my-services-common) -->
<artifactId>platform-services-common</artifactId>
<groupId>${project.groupId}</groupId>
<type>test-jar</type>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* (C) Copyright IBM Corp. 2026.
*
* 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.
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.111.0-1bfb72c2-20260206-185521
*/

package com.ibm.cloud.platform_services.account_management.v4;

import com.ibm.cloud.platform_services.account_management.v4.model.AccountResponse;
import com.ibm.cloud.platform_services.account_management.v4.model.GetAccountOptions;
import com.ibm.cloud.platform_services.common.SdkCommon;
import com.ibm.cloud.sdk.core.http.RequestBuilder;
import com.ibm.cloud.sdk.core.http.ResponseConverter;
import com.ibm.cloud.sdk.core.http.ServiceCall;
import com.ibm.cloud.sdk.core.security.Authenticator;
import com.ibm.cloud.sdk.core.security.ConfigBasedAuthenticatorFactory;
import com.ibm.cloud.sdk.core.service.BaseService;
import com.ibm.cloud.sdk.core.util.ResponseConverterUtils;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

/**
* The Account Management API allows for the management of Account.
*
* API Version: 4.0.0
*/
public class AccountManagement extends BaseService {

/**
* Default service name used when configuring the `AccountManagement` client.
*/
public static final String DEFAULT_SERVICE_NAME = "account_management";

/**
* Default service endpoint URL.
*/
public static final String DEFAULT_SERVICE_URL = "https://accounts.test.cloud.ibm.com";

/**
* Class method which constructs an instance of the `AccountManagement` client.
* The default service name is used to configure the client instance.
*
* @return an instance of the `AccountManagement` client using external configuration
*/
public static AccountManagement newInstance() {
return newInstance(DEFAULT_SERVICE_NAME);
}

/**
* Class method which constructs an instance of the `AccountManagement` client.
* The specified service name is used to configure the client instance.
*
* @param serviceName the service name to be used when configuring the client instance
* @return an instance of the `AccountManagement` client using external configuration
*/
public static AccountManagement newInstance(String serviceName) {
Authenticator authenticator = ConfigBasedAuthenticatorFactory.getAuthenticator(serviceName);
AccountManagement service = new AccountManagement(serviceName, authenticator);
service.configureService(serviceName);
return service;
}

/**
* Constructs an instance of the `AccountManagement` client.
* The specified service name and authenticator are used to configure the client instance.
*
* @param serviceName the service name to be used when configuring the client instance
* @param authenticator the {@link Authenticator} instance to be configured for this client
*/
public AccountManagement(String serviceName, Authenticator authenticator) {
super(serviceName, authenticator);
setServiceUrl(DEFAULT_SERVICE_URL);
}

/**
* Get Account by Account ID.
*
* Returns the details of an account.
*
* @param getAccountOptions the {@link GetAccountOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link AccountResponse}
*/
public ServiceCall<AccountResponse> getAccount(GetAccountOptions getAccountOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(getAccountOptions,
"getAccountOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
pathParamsMap.put("account_id", getAccountOptions.accountId());
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v4/accounts/{account_id}", pathParamsMap));
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("account_management", "v4", "getAccount");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
ResponseConverter<AccountResponse> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<AccountResponse>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*
* (C) Copyright IBM Corp. 2026.
*
* 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.ibm.cloud.platform_services.account_management.v4.model;

import com.google.gson.annotations.SerializedName;
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* AccountResponse.
*/
public class AccountResponse extends GenericModel {

protected String name;
protected String id;
protected String owner;
@SerializedName("owner_userid")
protected String ownerUserid;
@SerializedName("owner_iamid")
protected String ownerIamid;
protected String type;
protected String status;
@SerializedName("linked_softlayer_account")
protected String linkedSoftlayerAccount;
@SerializedName("team_directory_enabled")
protected Boolean teamDirectoryEnabled;
protected AccountResponseTraits traits;

protected AccountResponse() { }

/**
* Gets the name.
*
* @return the name
*/
public String getName() {
return name;
}

/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}

/**
* Gets the owner.
*
* @return the owner
*/
public String getOwner() {
return owner;
}

/**
* Gets the ownerUserid.
*
* @return the ownerUserid
*/
public String getOwnerUserid() {
return ownerUserid;
}

/**
* Gets the ownerIamid.
*
* @return the ownerIamid
*/
public String getOwnerIamid() {
return ownerIamid;
}

/**
* Gets the type.
*
* @return the type
*/
public String getType() {
return type;
}

/**
* Gets the status.
*
* @return the status
*/
public String getStatus() {
return status;
}

/**
* Gets the linkedSoftlayerAccount.
*
* @return the linkedSoftlayerAccount
*/
public String getLinkedSoftlayerAccount() {
return linkedSoftlayerAccount;
}

/**
* Gets the teamDirectoryEnabled.
*
* @return the teamDirectoryEnabled
*/
public Boolean isTeamDirectoryEnabled() {
return teamDirectoryEnabled;
}

/**
* Gets the traits.
*
* @return the traits
*/
public AccountResponseTraits getTraits() {
return traits;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* (C) Copyright IBM Corp. 2026.
*
* 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.ibm.cloud.platform_services.account_management.v4.model;

import com.google.gson.annotations.SerializedName;
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* AccountResponseTraits.
*/
public class AccountResponseTraits extends GenericModel {

@SerializedName("eu_supported")
protected Boolean euSupported;
protected Boolean poc;
protected Boolean hippa;

protected AccountResponseTraits() { }

/**
* Gets the euSupported.
*
* @return the euSupported
*/
public Boolean isEuSupported() {
return euSupported;
}

/**
* Gets the poc.
*
* @return the poc
*/
public Boolean isPoc() {
return poc;
}

/**
* Gets the hippa.
*
* @return the hippa
*/
public Boolean isHippa() {
return hippa;
}
}

Loading