Skip to content

Commit

Permalink
feat: [privateca] added ignore_dependent_resources to DeleteCaPoolReq…
Browse files Browse the repository at this point in the history
…uest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest (#9317)

* feat: added ignore_dependent_resources to DeleteCaPoolRequest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest

PiperOrigin-RevId: 522096199

Source-Link: googleapis/googleapis@d9592ed

Source-Link: googleapis/googleapis-gen@0ab428e
Copy-Tag: eyJwIjoiamF2YS1zZWN1cml0eS1wcml2YXRlLWNhLy5Pd2xCb3QueWFtbCIsImgiOiIwYWI0MjhlMzkzNDk4MWRiOWM4YzdiZjE3YjFmZWE1ZDc0NjgyYWZiIn0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Apr 12, 2023
1 parent 287315c commit 87dc1fc
Show file tree
Hide file tree
Showing 22 changed files with 775 additions and 357 deletions.
2 changes: 1 addition & 1 deletion java-security-private-ca/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.11.0</version>
<version>26.12.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,7 @@ public final UnaryCallable<UpdateCertificateRequest, Certificate> updateCertific
* "[PROJECT]", "[LOCATION]", "[CA_POOL]", "[CERTIFICATE_AUTHORITY]")
* .toString())
* .setRequestId("requestId693933066")
* .setIgnoreDependentResources(true)
* .build();
* CertificateAuthority response =
* certificateAuthorityServiceClient.disableCertificateAuthorityAsync(request).get();
Expand Down Expand Up @@ -1478,6 +1479,7 @@ public final UnaryCallable<UpdateCertificateRequest, Certificate> updateCertific
* "[PROJECT]", "[LOCATION]", "[CA_POOL]", "[CERTIFICATE_AUTHORITY]")
* .toString())
* .setRequestId("requestId693933066")
* .setIgnoreDependentResources(true)
* .build();
* OperationFuture<CertificateAuthority, OperationMetadata> future =
* certificateAuthorityServiceClient
Expand Down Expand Up @@ -1515,6 +1517,7 @@ public final UnaryCallable<UpdateCertificateRequest, Certificate> updateCertific
* "[PROJECT]", "[LOCATION]", "[CA_POOL]", "[CERTIFICATE_AUTHORITY]")
* .toString())
* .setRequestId("requestId693933066")
* .setIgnoreDependentResources(true)
* .build();
* ApiFuture<Operation> future =
* certificateAuthorityServiceClient
Expand Down Expand Up @@ -2489,6 +2492,7 @@ public final ListCertificateAuthoritiesPagedResponse listCertificateAuthorities(
* .setRequestId("requestId693933066")
* .setIgnoreActiveCertificates(true)
* .setSkipGracePeriod(true)
* .setIgnoreDependentResources(true)
* .build();
* CertificateAuthority response =
* certificateAuthorityServiceClient.deleteCertificateAuthorityAsync(request).get();
Expand Down Expand Up @@ -2526,6 +2530,7 @@ public final ListCertificateAuthoritiesPagedResponse listCertificateAuthorities(
* .setRequestId("requestId693933066")
* .setIgnoreActiveCertificates(true)
* .setSkipGracePeriod(true)
* .setIgnoreDependentResources(true)
* .build();
* OperationFuture<CertificateAuthority, OperationMetadata> future =
* certificateAuthorityServiceClient
Expand Down Expand Up @@ -2565,6 +2570,7 @@ public final ListCertificateAuthoritiesPagedResponse listCertificateAuthorities(
* .setRequestId("requestId693933066")
* .setIgnoreActiveCertificates(true)
* .setSkipGracePeriod(true)
* .setIgnoreDependentResources(true)
* .build();
* ApiFuture<Operation> future =
* certificateAuthorityServiceClient
Expand Down Expand Up @@ -3402,6 +3408,7 @@ public final OperationFuture<Empty, OperationMetadata> deleteCaPoolAsync(String
* DeleteCaPoolRequest.newBuilder()
* .setName(CaPoolName.of("[PROJECT]", "[LOCATION]", "[CA_POOL]").toString())
* .setRequestId("requestId693933066")
* .setIgnoreDependentResources(true)
* .build();
* certificateAuthorityServiceClient.deleteCaPoolAsync(request).get();
* }
Expand Down Expand Up @@ -3433,6 +3440,7 @@ public final OperationFuture<Empty, OperationMetadata> deleteCaPoolAsync(
* DeleteCaPoolRequest.newBuilder()
* .setName(CaPoolName.of("[PROJECT]", "[LOCATION]", "[CA_POOL]").toString())
* .setRequestId("requestId693933066")
* .setIgnoreDependentResources(true)
* .build();
* OperationFuture<Empty, OperationMetadata> future =
* certificateAuthorityServiceClient.deleteCaPoolOperationCallable().futureCall(request);
Expand Down Expand Up @@ -3464,6 +3472,7 @@ public final OperationFuture<Empty, OperationMetadata> deleteCaPoolAsync(
* DeleteCaPoolRequest.newBuilder()
* .setName(CaPoolName.of("[PROJECT]", "[LOCATION]", "[CA_POOL]").toString())
* .setRequestId("requestId693933066")
* .setIgnoreDependentResources(true)
* .build();
* ApiFuture<Operation> future =
* certificateAuthorityServiceClient.deleteCaPoolCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,10 @@ public class HttpJsonCertificateAuthorityServiceStub extends CertificateAuthorit
fields,
"ignoreActiveCertificates",
request.getIgnoreActiveCertificates());
serializer.putQueryParam(
fields,
"ignoreDependentResources",
request.getIgnoreDependentResources());
serializer.putQueryParam(fields, "requestId", request.getRequestId());
serializer.putQueryParam(
fields, "skipGracePeriod", request.getSkipGracePeriod());
Expand Down Expand Up @@ -925,6 +929,10 @@ public class HttpJsonCertificateAuthorityServiceStub extends CertificateAuthorit
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<DeleteCaPoolRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(
fields,
"ignoreDependentResources",
request.getIgnoreDependentResources());
serializer.putQueryParam(fields, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,27 @@ public com.google.protobuf.ByteString getRequestIdBytes() {
}
}

public static final int IGNORE_DEPENDENT_RESOURCES_FIELD_NUMBER = 4;
private boolean ignoreDependentResources_ = false;
/**
*
*
* <pre>
* Optional. This field allows this pool to be deleted even if it's being
* depended on by another resource. However, doing so may result in unintended
* and unrecoverable effects on any dependent resource(s) since the pool will
* no longer be able to issue certificates.
* </pre>
*
* <code>bool ignore_dependent_resources = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The ignoreDependentResources.
*/
@java.lang.Override
public boolean getIgnoreDependentResources() {
return ignoreDependentResources_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand All @@ -219,6 +240,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_);
}
if (ignoreDependentResources_ != false) {
output.writeBool(4, ignoreDependentResources_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -234,6 +258,9 @@ public int getSerializedSize() {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_);
}
if (ignoreDependentResources_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, ignoreDependentResources_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -252,6 +279,7 @@ public boolean equals(final java.lang.Object obj) {

if (!getName().equals(other.getName())) return false;
if (!getRequestId().equals(other.getRequestId())) return false;
if (getIgnoreDependentResources() != other.getIgnoreDependentResources()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -267,6 +295,8 @@ public int hashCode() {
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER;
hash = (53 * hash) + getRequestId().hashCode();
hash = (37 * hash) + IGNORE_DEPENDENT_RESOURCES_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreDependentResources());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -410,6 +440,7 @@ public Builder clear() {
bitField0_ = 0;
name_ = "";
requestId_ = "";
ignoreDependentResources_ = false;
return this;
}

Expand Down Expand Up @@ -452,6 +483,9 @@ private void buildPartial0(com.google.cloud.security.privateca.v1.DeleteCaPoolRe
if (((from_bitField0_ & 0x00000002) != 0)) {
result.requestId_ = requestId_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.ignoreDependentResources_ = ignoreDependentResources_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -510,6 +544,9 @@ public Builder mergeFrom(com.google.cloud.security.privateca.v1.DeleteCaPoolRequ
bitField0_ |= 0x00000002;
onChanged();
}
if (other.getIgnoreDependentResources() != false) {
setIgnoreDependentResources(other.getIgnoreDependentResources());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -548,6 +585,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000002;
break;
} // case 18
case 32:
{
ignoreDependentResources_ = input.readBool();
bitField0_ |= 0x00000004;
break;
} // case 32
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -849,6 +892,68 @@ public Builder setRequestIdBytes(com.google.protobuf.ByteString value) {
return this;
}

private boolean ignoreDependentResources_;
/**
*
*
* <pre>
* Optional. This field allows this pool to be deleted even if it's being
* depended on by another resource. However, doing so may result in unintended
* and unrecoverable effects on any dependent resource(s) since the pool will
* no longer be able to issue certificates.
* </pre>
*
* <code>bool ignore_dependent_resources = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The ignoreDependentResources.
*/
@java.lang.Override
public boolean getIgnoreDependentResources() {
return ignoreDependentResources_;
}
/**
*
*
* <pre>
* Optional. This field allows this pool to be deleted even if it's being
* depended on by another resource. However, doing so may result in unintended
* and unrecoverable effects on any dependent resource(s) since the pool will
* no longer be able to issue certificates.
* </pre>
*
* <code>bool ignore_dependent_resources = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The ignoreDependentResources to set.
* @return This builder for chaining.
*/
public Builder setIgnoreDependentResources(boolean value) {

ignoreDependentResources_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. This field allows this pool to be deleted even if it's being
* depended on by another resource. However, doing so may result in unintended
* and unrecoverable effects on any dependent resource(s) since the pool will
* no longer be able to issue certificates.
* </pre>
*
* <code>bool ignore_dependent_resources = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearIgnoreDependentResources() {
bitField0_ = (bitField0_ & ~0x00000004);
ignoreDependentResources_ = false;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,20 @@ public interface DeleteCaPoolRequestOrBuilder
* @return The bytes for requestId.
*/
com.google.protobuf.ByteString getRequestIdBytes();

/**
*
*
* <pre>
* Optional. This field allows this pool to be deleted even if it's being
* depended on by another resource. However, doing so may result in unintended
* and unrecoverable effects on any dependent resource(s) since the pool will
* no longer be able to issue certificates.
* </pre>
*
* <code>bool ignore_dependent_resources = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The ignoreDependentResources.
*/
boolean getIgnoreDependentResources();
}
Loading

0 comments on commit 87dc1fc

Please sign in to comment.