Skip to content

Commit

Permalink
Merge pull request #14 from IBM/update
Browse files Browse the repository at this point in the history
update sdk
  • Loading branch information
IdanAdar authored Feb 21, 2021
2 parents 3fb3003 + 82fcc73 commit 3a48026
Show file tree
Hide file tree
Showing 16 changed files with 152 additions and 48 deletions.
2 changes: 1 addition & 1 deletion build-settings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
Expand Down
2 changes: 1 addition & 1 deletion modules/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>secrets-manager-sdk</artifactId>
<groupId>com.ibm.cloud</groupId>
<version>0.0.3</version>
<version>0.0.4</version>
<relativePath>../..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ protected static void readBuildProperties() {
* This function uses lazy initialization to build the SDK's "user agent" value.
* This will consist of the SDK name and version, followed by
* a set of properties provided by the Java Core's RequestUtils class.
*
* @return the SDK-specific user agent value
*/
private static synchronized String getUserAgent() {
Expand All @@ -89,7 +90,7 @@ private static synchronized String getUserAgent() {
* 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.
*
* <p>
* If you plan to gather metrics for your SDK, the User-Agent header value must
* be a string similar to the following:
* my-java-sdk/0.0.1 (lang=java; java.vendor=AdoptOpenJDK; java.version=1.8.0_232; os.arch=x86_64; os.name=Linux; os.version=5.1)
Expand All @@ -99,16 +100,13 @@ private static synchronized String getUserAgent() {
* "0.0.1"- the version of your sdk
* "lang=java" - the language of the current sdk
* "java.vendor=AdoptOpenJDK; java.version=1.8.0_232; os.arch=x86_64; os.name=Linux; os.version=5.1" - system information
*
* <p>
* Note: It is very important that the sdk name ends with the string `-sdk`,
* as the analytics data collector uses this to gather usage data.
*
* @param serviceName
* the name of the service as defined in the API definition (e.g. "MyService1")
* @param serviceVersion
* the version of the service as defined in the API definition (e.g. "V1")
* @param operationId
* the operationId as defined in the API definition (e.g. getContext)
* @param serviceName the name of the service as defined in the API definition (e.g. "MyService1")
* @param serviceVersion the version of the service as defined in the API definition (e.g. "V1")
* @param operationId the operationId as defined in the API definition (e.g. getContext)
* @return a Map which contains the set of headers to be included in the REST API request
*/
public static Map<String, String> getSdkHeaders(String serviceName, String serviceVersion, String operationId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public abstract class SdkIntegrationTestBase {
/**
* Returns true if and only if test methods within the subclass should be skipped due to
* lack of an external configuration file.
*
* @return
*/
protected boolean skipTests() {
Expand All @@ -42,6 +43,7 @@ protected boolean skipTests() {
/**
* Each subclass must implement this method in order to provide the name of the
* testcase's config file.
*
* @return the name of the config file associated with the testcase
*/
public abstract String getConfigFilename();
Expand Down
6 changes: 3 additions & 3 deletions modules/coverage-reports/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>secrets-manager-sdk</artifactId>
<groupId>com.ibm.cloud</groupId>
<version>0.0.3</version>
<version>0.0.4</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand All @@ -14,8 +14,8 @@

<properties>
<!-- There is no need to publish this module's artifacts on maven central -->
<!-- <maven.deploy.skip>true</maven.deploy.skip>-->
<!-- <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>-->
<!-- <maven.deploy.skip>true</maven.deploy.skip>-->
<!-- <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>-->
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion modules/ibm-cloud-secrets-manager-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>secrets-manager-sdk</artifactId>
<groupId>com.ibm.cloud</groupId>
<version>0.0.3</version>
<version>0.0.4</version>
<relativePath>../..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.26.0-4b317b0c-20210127-171701
* IBM OpenAPI SDK Code Generator Version: 3.28.0-55613c9e-20210220-164656
*/

package com.ibm.cloud.ibm_cloud_secrets_manager_api.v1;
Expand Down Expand Up @@ -57,7 +57,7 @@

/**
* With IBM Cloud® Secrets Manager, you can create, lease, and centrally manage secrets that are used in IBM Cloud
* services or your custom-built applications. Secrets are stored in a dedicated instance of Secrets Manager, backed by
* services or your custom-built applications. Secrets are stored in a dedicated instance of Secrets Manager, built on
* open source HashiCorp Vault.
*
* @version v1
Expand Down Expand Up @@ -157,8 +157,8 @@ public ServiceCall<EngineConfigOneOf> getConfig(GetConfigOptions getConfigOption
* Set secret policies.
* <p>
* Creates or updates one or more policies, such as an [automatic rotation
* policy](http://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-rotate-secrets#auto-rotate-secret), for
* the specified secret.
* policy](http://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-rotate-secrets#auto-rotate-secret), for the
* specified secret.
*
* @param putPolicyOptions the {@link PutPolicyOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link GetSecretPoliciesOneOf}
Expand Down Expand Up @@ -449,6 +449,12 @@ public ServiceCall<ListSecrets> listAllSecrets(ListAllSecretsOptions listAllSecr
if (listAllSecretsOptions.offset() != null) {
builder.query("offset", String.valueOf(listAllSecretsOptions.offset()));
}
if (listAllSecretsOptions.search() != null) {
builder.query("search", String.valueOf(listAllSecretsOptions.search()));
}
if (listAllSecretsOptions.sortBy() != null) {
builder.query("sort_by", String.valueOf(listAllSecretsOptions.sortBy()));
}
ResponseConverter<ListSecrets> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<ListSecrets>() {
}.getType());
Expand All @@ -473,7 +479,7 @@ public ServiceCall<ListSecrets> listAllSecrets() {
* <p>
* A successful request returns the secret data that is associated with your secret, along with other metadata. To
* view only the details of a specified secret without retrieving its value, use the [Get secret
* metadata](#get-secret-metadata) method.
* metadata](#get-secret-metadata) method.
*
* @param getSecretOptions the {@link GetSecretOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link GetSecret}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,54 @@
*/
public class ListAllSecretsOptions extends GenericModel {

/**
* Sorts a list of secrets by the field that you specify.
* <p>
* **Usage:** To sort a list of secrets by their creation date, use
* `../secrets/{secret-type}?sort_by=creation_date`.
*/
public interface SortBy {
/**
* id.
*/
String ID = "id";
/**
* creation_date.
*/
String CREATION_DATE = "creation_date";
/**
* expiration_date.
*/
String EXPIRATION_DATE = "expiration_date";
/**
* secret_type.
*/
String SECRET_TYPE = "secret_type";
/**
* name.
*/
String NAME = "name";
}

protected Long limit;
protected Long offset;
protected String search;
protected String sortBy;

/**
* Builder.
*/
public static class Builder {
private Long limit;
private Long offset;
private String search;
private String sortBy;

private Builder(ListAllSecretsOptions listAllSecretsOptions) {
this.limit = listAllSecretsOptions.limit;
this.offset = listAllSecretsOptions.offset;
this.search = listAllSecretsOptions.search;
this.sortBy = listAllSecretsOptions.sortBy;
}

/**
Expand Down Expand Up @@ -70,11 +105,35 @@ public Builder offset(long offset) {
this.offset = offset;
return this;
}

/**
* Set the search.
*
* @param search the search
* @return the ListAllSecretsOptions builder
*/
public Builder search(String search) {
this.search = search;
return this;
}

/**
* Set the sortBy.
*
* @param sortBy the sortBy
* @return the ListAllSecretsOptions builder
*/
public Builder sortBy(String sortBy) {
this.sortBy = sortBy;
return this;
}
}

protected ListAllSecretsOptions(Builder builder) {
limit = builder.limit;
offset = builder.offset;
search = builder.search;
sortBy = builder.sortBy;
}

/**
Expand Down Expand Up @@ -115,5 +174,34 @@ public Long limit() {
public Long offset() {
return offset;
}

/**
* Gets the search.
* <p>
* Filters for secrets that contain the string that you specify. The fields that are searched include: id, name,
* description, labels, secret_type.
* <p>
* **Usage:** If you want to list only the secrets that contain the string "text", use
* `../secrets/{secret-type}?search=text`.
*
* @return the search
*/
public String search() {
return search;
}

/**
* Gets the sortBy.
* <p>
* Sorts a list of secrets by the field that you specify.
* <p>
* **Usage:** To sort a list of secrets by their creation date, use
* `../secrets/{secret-type}?sort_by=creation_date`.
*
* @return the sortBy
*/
public String sortBy() {
return sortBy;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public String secretType() {
/**
* Gets the crn.
* <p>
* The Cloud Resource Name (CRN) that uniquely identifies your cloud resources.
* The Cloud Resource Name (CRN) that uniquely identifies your Secrets Manager resource.
*
* @return the crn
*/
Expand Down Expand Up @@ -294,7 +294,7 @@ public Map<String, Object> secretData() {
/**
* Gets the username.
* <p>
* The username assigend to the username-password secret.
* The username to assign to this secret.
*
* @return the username
*/
Expand All @@ -305,7 +305,7 @@ public String username() {
/**
* Gets the password.
* <p>
* The password assigend to the username-password secret.
* The password to assign to this secret.
*
* @return the password
*/
Expand Down Expand Up @@ -360,7 +360,9 @@ public List<String> accessGroups() {
/**
* Gets the apiKey.
* <p>
* The IAM API key of this IAM secret.
* The API key that is generated for this secret.
* <p>
* After the secret reaches the end of its lease (see the `ttl` field), the API key is revoked automatically.
*
* @return the apiKey
*/
Expand All @@ -371,8 +373,8 @@ public String apiKey() {
/**
* Gets the serviceId.
* <p>
* The IAM ServiceID under which the IAM API key (see the api_key field) was created. This ServiceID is assigned to
* the access_groups defined for this IAM secret.
* The service ID under which the API key (see the `api_key` field) is created. This service ID is added to the access
* groups that you assign for this secret.
*
* @return the serviceId
*/
Expand Down
Loading

0 comments on commit 3a48026

Please sign in to comment.