Skip to content

Commit

Permalink
Merge pull request #96 from IBM/prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
IdanAdar authored Aug 5, 2024
2 parents 7966cca + fa77972 commit f7c1051
Show file tree
Hide file tree
Showing 223 changed files with 891 additions and 575 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.GetSecretOptions;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.GetSecretVersionMetadataOptions;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.GetSecretVersionOptions;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.IAMCredentialsConfigurationPatch;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.ListConfigurationsOptions;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.ListSecretGroupsOptions;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.ListSecretLocksOptions;
Expand All @@ -62,8 +61,9 @@
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.NotificationsRegistration;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.PrivateCertificateActionRevokePrototype;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.PrivateCertificateConfigurationActionRotateCRLPrototype;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.PrivateCertificateConfigurationRootCAPrototype;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.PrivateCertificateVersionActionRevokePrototype;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.PublicCertificateConfigurationDNSCloudInternetServicesPatch;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.PublicCertificateConfigurationDNSCloudInternetServicesPrototype;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.Secret;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.SecretAction;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model.SecretGroup;
Expand Down Expand Up @@ -270,26 +270,11 @@ public static void main(String[] args) throws Exception {
try {
System.out.println("createConfiguration() result:");
// begin-create_configuration
PrivateCertificateConfigurationRootCAPrototype configurationPrototypeModel = new PrivateCertificateConfigurationRootCAPrototype.Builder()
.configType("private_cert_configuration_root_ca")
.name("example-root-CA")
.maxTtl("43830h")
.crlExpiry("72h")
.crlDisable(false)
.crlDistributionPointsEncoded(true)
.issuingCertificatesUrlsEncoded(true)
.commonName("example.com")
.altNames(java.util.Arrays.asList("alt-name-1", "alt-name-2"))
.ipSans("127.0.0.1")
.uriSans("https://www.example.com/test")
.otherSans(java.util.Arrays.asList("1.2.3.5.4.3.201.10.4.3;utf8:[email protected]"))
.ttl("2190h")
.format("pem")
.privateKeyFormat("der")
.keyType("rsa")
.keyBits(Long.valueOf("4096"))
.maxPathLength(Long.valueOf("-1"))
.excludeCnFromSans(false)
PublicCertificateConfigurationDNSCloudInternetServicesPrototype configurationPrototypeModel = new PublicCertificateConfigurationDNSCloudInternetServicesPrototype.Builder()
.configType("public_cert_configuration_dns_cloud_internet_services")
.name("example-cloud-internet-services-config")
.cloudInternetServicesApikey("5ipu_ykv0PMp2MhxQnDMn7VzrkSlBwi3BOI8uthi_EXZ")
.cloudInternetServicesCrn("crn:v1:bluemix:public:internet-svcs:global:a/128e84fcca45c1224aae525d31ef2b52:009a0357-1460-42b4-b903-10580aba7dd8::")
.build();
CreateConfigurationOptions createConfigurationOptions = new CreateConfigurationOptions.Builder()
.configurationPrototype(configurationPrototypeModel)
Expand Down Expand Up @@ -663,6 +648,7 @@ public static void main(String[] args) throws Exception {
.limit(Long.valueOf("10"))
.sort("config_type")
.search("example")
.secretTypes(java.util.Arrays.asList("iam_credentials", "public_cert", "private_cert"))
.build();

ConfigurationsPager pager = new ConfigurationsPager(secretsManagerService, listConfigurationsOptions);
Expand All @@ -684,7 +670,7 @@ public static void main(String[] args) throws Exception {
// begin-get_configuration
GetConfigurationOptions getConfigurationOptions = new GetConfigurationOptions.Builder()
.name(configurationNameForGetConfigurationLink)
.xSmAcceptConfigurationType("private_cert_configuration_root_ca")
.xSmAcceptConfigurationType("public_cert_configuration_dns_cloud_internet_services")
.build();

Response<Configuration> response = secretsManagerService.getConfiguration(getConfigurationOptions).execute();
Expand All @@ -700,14 +686,15 @@ public static void main(String[] args) throws Exception {
try {
System.out.println("updateConfiguration() result:");
// begin-update_configuration
IAMCredentialsConfigurationPatch configurationPatchModel = new IAMCredentialsConfigurationPatch.Builder()
.apiKey("RmnPBn6n1dzoo0v3kyznKEpg0WzdTpW9lW7FtKa017_u")
PublicCertificateConfigurationDNSCloudInternetServicesPatch configurationPatchModel = new PublicCertificateConfigurationDNSCloudInternetServicesPatch.Builder()
.cloudInternetServicesApikey("5ipu_ykv0PMp2MhxQnDMn7VzrkSlBwi3BOI8uthi_EXZ")
.cloudInternetServicesCrn("crn:v1:bluemix:public:internet-svcs:global:a/128e84fcca45c1224aae525d31ef2b52:009a0357-1460-42b4-b903-10580aba7dd8::")
.build();
Map<String, Object> configurationPatchModelAsPatch = configurationPatchModel.asPatch();
UpdateConfigurationOptions updateConfigurationOptions = new UpdateConfigurationOptions.Builder()
.name(configurationNameForGetConfigurationLink)
.configurationPatch(configurationPatchModelAsPatch)
.xSmAcceptConfigurationType("private_cert_configuration_root_ca")
.xSmAcceptConfigurationType("public_cert_configuration_dns_cloud_internet_services")
.build();

Response<Configuration> response = secretsManagerService.updateConfiguration(updateConfigurationOptions).execute();
Expand All @@ -729,7 +716,7 @@ public static void main(String[] args) throws Exception {
CreateConfigurationActionOptions createConfigurationActionOptions = new CreateConfigurationActionOptions.Builder()
.name(configurationNameForGetConfigurationLink)
.configActionPrototype(configurationActionPrototypeModel)
.xSmAcceptConfigurationType("private_cert_configuration_root_ca")
.xSmAcceptConfigurationType("public_cert_configuration_dns_cloud_internet_services")
.build();

Response<ConfigurationAction> response = secretsManagerService.createConfigurationAction(createConfigurationActionOptions).execute();
Expand Down Expand Up @@ -872,7 +859,7 @@ public static void main(String[] args) throws Exception {
// begin-delete_configuration
DeleteConfigurationOptions deleteConfigurationOptions = new DeleteConfigurationOptions.Builder()
.name(configurationNameForGetConfigurationLink)
.xSmAcceptConfigurationType("private_cert_configuration_root_ca")
.xSmAcceptConfigurationType("public_cert_configuration_dns_cloud_internet_services")
.build();

Response<Void> response = secretsManagerService.deleteConfiguration(deleteConfigurationOptions).execute();
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.86.1-c3d7bcef-20240308-215042
* IBM OpenAPI SDK Code Generator Version: 3.93.0-c40121e6-20240729-182103
*/

package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2;
Expand Down Expand Up @@ -280,7 +280,7 @@ public ServiceCall<SecretGroup> updateSecretGroup(UpdateSecretGroupOptions updat
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(updateSecretGroupOptions.secretGroupPatch()), "application/merge-patch+json");
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSecretGroupOptions.secretGroupPatch()), "application/merge-patch+json");
ResponseConverter<SecretGroup> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<SecretGroup>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down Expand Up @@ -490,7 +490,7 @@ public ServiceCall<SecretMetadata> updateSecretMetadata(UpdateSecretMetadataOpti
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(updateSecretMetadataOptions.secretMetadataPatch()), "application/merge-patch+json");
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSecretMetadataOptions.secretMetadataPatch()), "application/merge-patch+json");
ResponseConverter<SecretMetadata> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<SecretMetadata>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down Expand Up @@ -704,7 +704,7 @@ public ServiceCall<SecretVersionMetadata> updateSecretVersionMetadata(UpdateSecr
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(updateSecretVersionMetadataOptions.secretVersionMetadataPatch()), "application/merge-patch+json");
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSecretVersionMetadataOptions.secretVersionMetadataPatch()), "application/merge-patch+json");
ResponseConverter<SecretVersionMetadata> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<SecretVersionMetadata>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down Expand Up @@ -1074,6 +1074,9 @@ public ServiceCall<ConfigurationMetadataPaginatedCollection> listConfigurations(
if (listConfigurationsOptions.search() != null) {
builder.query("search", String.valueOf(listConfigurationsOptions.search()));
}
if (listConfigurationsOptions.secretTypes() != null) {
builder.query("secret_types", RequestUtils.join(listConfigurationsOptions.secretTypes(), ","));
}
ResponseConverter<ConfigurationMetadataPaginatedCollection> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<ConfigurationMetadataPaginatedCollection>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down Expand Up @@ -1141,7 +1144,7 @@ public ServiceCall<Configuration> updateConfiguration(UpdateConfigurationOptions
if (updateConfigurationOptions.xSmAcceptConfigurationType() != null) {
builder.header("X-Sm-Accept-Configuration-Type", updateConfigurationOptions.xSmAcceptConfigurationType());
}
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(updateConfigurationOptions.configurationPatch()), "application/merge-patch+json");
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateConfigurationOptions.configurationPatch()), "application/merge-patch+json");
ResponseConverter<Configuration> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<Configuration>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

import java.util.ArrayList;
Expand Down Expand Up @@ -166,6 +167,5 @@ public Builder newBuilder() {
public Map<String, Object> asPatch() {
return GsonSingleton.getGson().fromJson(this.toString(), Map.class);
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

import java.util.Date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

import java.util.Date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

import java.util.Date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

import java.util.Date;
Expand All @@ -36,36 +37,35 @@ public class Configuration extends GenericModel {
protected static java.util.Map<String, Class<?>> discriminatorMapping;
static {
discriminatorMapping = new java.util.HashMap<>();
discriminatorMapping.put("public_cert_configuration_ca_lets_encrypt", PublicCertificateConfigurationCALetsEncrypt.class);
discriminatorMapping.put("public_cert_configuration_dns_cloud_internet_services", PublicCertificateConfigurationDNSCloudInternetServices.class);
discriminatorMapping.put("public_cert_configuration_dns_classic_infrastructure", PublicCertificateConfigurationDNSClassicInfrastructure.class);
discriminatorMapping.put("public_cert_configuration_ca_lets_encrypt", PublicCertificateConfigurationCALetsEncrypt.class);
discriminatorMapping.put("iam_credentials_configuration", IAMCredentialsConfiguration.class);
discriminatorMapping.put("private_cert_configuration_root_ca", PrivateCertificateConfigurationRootCA.class);
discriminatorMapping.put("private_cert_configuration_intermediate_ca", PrivateCertificateConfigurationIntermediateCA.class);
discriminatorMapping.put("private_cert_configuration_template", PrivateCertificateConfigurationTemplate.class);
}

/**
* The configuration type. Can be one of: iam_credentials_configuration, public_cert_configuration_ca_lets_encrypt,
* public_cert_configuration_dns_classic_infrastructure, public_cert_configuration_dns_cloud_internet_services,
* private_cert_configuration_root_ca, private_cert_configuration_intermediate_ca,
* private_cert_configuration_template.
*/
public interface ConfigType {
/** public_cert_configuration_ca_lets_encrypt. */
String PUBLIC_CERT_CONFIGURATION_CA_LETS_ENCRYPT = "public_cert_configuration_ca_lets_encrypt";
/** public_cert_configuration_dns_classic_infrastructure. */
String PUBLIC_CERT_CONFIGURATION_DNS_CLASSIC_INFRASTRUCTURE = "public_cert_configuration_dns_classic_infrastructure";
/** public_cert_configuration_dns_cloud_internet_services. */
String PUBLIC_CERT_CONFIGURATION_DNS_CLOUD_INTERNET_SERVICES = "public_cert_configuration_dns_cloud_internet_services";
/** iam_credentials_configuration. */
String IAM_CREDENTIALS_CONFIGURATION = "iam_credentials_configuration";
/** public_cert_configuration_dns_classic_infrastructure. */
String PUBLIC_CERT_CONFIGURATION_DNS_CLASSIC_INFRASTRUCTURE = "public_cert_configuration_dns_classic_infrastructure";
/** public_cert_configuration_ca_lets_encrypt. */
String PUBLIC_CERT_CONFIGURATION_CA_LETS_ENCRYPT = "public_cert_configuration_ca_lets_encrypt";
/** private_cert_configuration_root_ca. */
String PRIVATE_CERT_CONFIGURATION_ROOT_CA = "private_cert_configuration_root_ca";
/** private_cert_configuration_intermediate_ca. */
String PRIVATE_CERT_CONFIGURATION_INTERMEDIATE_CA = "private_cert_configuration_intermediate_ca";
/** private_cert_configuration_template. */
String PRIVATE_CERT_CONFIGURATION_TEMPLATE = "private_cert_configuration_template";
/** iam_credentials_configuration. */
String IAM_CREDENTIALS_CONFIGURATION = "iam_credentials_configuration";
}

/**
Expand Down Expand Up @@ -202,6 +202,8 @@ public interface SigningMethod {
@SerializedName("key_bits")
protected Long keyBits;
protected String status;
@SerializedName("crypto_key")
protected PrivateCertificateCryptoKey cryptoKey;
@SerializedName("max_ttl_seconds")
protected Long maxTtlSeconds;
@SerializedName("crl_expiry_seconds")
Expand Down Expand Up @@ -555,6 +557,17 @@ public String getStatus() {
return status;
}

/**
* Gets the cryptoKey.
*
* The data that is associated with a cryptographic key.
*
* @return the cryptoKey
*/
public PrivateCertificateCryptoKey getCryptoKey() {
return cryptoKey;
}

/**
* Gets the maxTtlSeconds.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 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.secrets_manager_sdk.secrets_manager.v2.model;

import java.util.List;
Expand Down Expand Up @@ -39,7 +40,6 @@ public class ConfigurationAction extends GenericModel {
discriminatorMapping.put("private_cert_configuration_action_set_signed", PrivateCertificateConfigurationActionSetSigned.class);
discriminatorMapping.put("private_cert_configuration_action_rotate_crl", PrivateCertificateConfigurationActionRotateCRL.class);
}

/**
* The type of configuration action.
*/
Expand Down
Loading

0 comments on commit f7c1051

Please sign in to comment.