Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
feat: added support OSInventory in Assets. docs: updated existing doc…
Browse files Browse the repository at this point in the history
…s. (#460)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/a6c4a7d3-b64f-4f2e-b1a4-1d6ec5678ff7/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 342689216
Source-Link: googleapis/googleapis@1f8a514
  • Loading branch information
yoshi-automation committed Nov 19, 2020
1 parent 0df6426 commit 7fecc7e
Show file tree
Hide file tree
Showing 10 changed files with 548 additions and 160 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Expand Up @@ -150,6 +150,11 @@
<artifactId>proto-google-identity-accesscontextmanager-v1</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-os-config-v1</artifactId>
<version>1.1.0</version>
</dependency>

<dependency>
<groupId>junit</groupId>
Expand Down
4 changes: 4 additions & 0 deletions proto-google-cloud-asset-v1/pom.xml
Expand Up @@ -41,6 +41,10 @@
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-identity-accesscontextmanager-v1</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-os-config-v1</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Expand Up @@ -223,6 +223,22 @@ private Asset(
updateTime_ = subBuilder.buildPartial();
}

break;
}
case 98:
{
com.google.cloud.osconfig.v1.Inventory.Builder subBuilder = null;
if (osInventory_ != null) {
subBuilder = osInventory_.toBuilder();
}
osInventory_ =
input.readMessage(
com.google.cloud.osconfig.v1.Inventory.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(osInventory_);
osInventory_ = subBuilder.buildPartial();
}

break;
}
default:
Expand Down Expand Up @@ -840,6 +856,60 @@ public com.google.identity.accesscontextmanager.v1.ServicePerimeter getServicePe
return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance();
}

public static final int OS_INVENTORY_FIELD_NUMBER = 12;
private com.google.cloud.osconfig.v1.Inventory osInventory_;
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*
* @return Whether the osInventory field is set.
*/
@java.lang.Override
public boolean hasOsInventory() {
return osInventory_ != null;
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*
* @return The osInventory.
*/
@java.lang.Override
public com.google.cloud.osconfig.v1.Inventory getOsInventory() {
return osInventory_ == null
? com.google.cloud.osconfig.v1.Inventory.getDefaultInstance()
: osInventory_;
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*/
@java.lang.Override
public com.google.cloud.osconfig.v1.InventoryOrBuilder getOsInventoryOrBuilder() {
return getOsInventory();
}

public static final int ANCESTORS_FIELD_NUMBER = 10;
private com.google.protobuf.LazyStringList ancestors_;
/**
Expand Down Expand Up @@ -972,6 +1042,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (updateTime_ != null) {
output.writeMessage(11, getUpdateTime());
}
if (osInventory_ != null) {
output.writeMessage(12, getOsInventory());
}
unknownFields.writeTo(output);
}

Expand Down Expand Up @@ -1023,6 +1096,9 @@ public int getSerializedSize() {
if (updateTime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getUpdateTime());
}
if (osInventory_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getOsInventory());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
Expand Down Expand Up @@ -1053,6 +1129,10 @@ public boolean equals(final java.lang.Object obj) {
if (!getIamPolicy().equals(other.getIamPolicy())) return false;
}
if (!getOrgPolicyList().equals(other.getOrgPolicyList())) return false;
if (hasOsInventory() != other.hasOsInventory()) return false;
if (hasOsInventory()) {
if (!getOsInventory().equals(other.getOsInventory())) return false;
}
if (!getAncestorsList().equals(other.getAncestorsList())) return false;
if (!getAccessContextPolicyCase().equals(other.getAccessContextPolicyCase())) return false;
switch (accessContextPolicyCase_) {
Expand Down Expand Up @@ -1099,6 +1179,10 @@ public int hashCode() {
hash = (37 * hash) + ORG_POLICY_FIELD_NUMBER;
hash = (53 * hash) + getOrgPolicyList().hashCode();
}
if (hasOsInventory()) {
hash = (37 * hash) + OS_INVENTORY_FIELD_NUMBER;
hash = (53 * hash) + getOsInventory().hashCode();
}
if (getAncestorsCount() > 0) {
hash = (37 * hash) + ANCESTORS_FIELD_NUMBER;
hash = (53 * hash) + getAncestorsList().hashCode();
Expand Down Expand Up @@ -1299,6 +1383,12 @@ public Builder clear() {
} else {
orgPolicyBuilder_.clear();
}
if (osInventoryBuilder_ == null) {
osInventory_ = null;
} else {
osInventory_ = null;
osInventoryBuilder_ = null;
}
ancestors_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
accessContextPolicyCase_ = 0;
Expand Down Expand Up @@ -1377,6 +1467,11 @@ public com.google.cloud.asset.v1.Asset buildPartial() {
result.accessContextPolicy_ = servicePerimeterBuilder_.build();
}
}
if (osInventoryBuilder_ == null) {
result.osInventory_ = osInventory_;
} else {
result.osInventory_ = osInventoryBuilder_.build();
}
if (((bitField0_ & 0x00000002) != 0)) {
ancestors_ = ancestors_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000002);
Expand Down Expand Up @@ -1476,6 +1571,9 @@ public Builder mergeFrom(com.google.cloud.asset.v1.Asset other) {
}
}
}
if (other.hasOsInventory()) {
mergeOsInventory(other.getOsInventory());
}
if (!other.ancestors_.isEmpty()) {
if (ancestors_.isEmpty()) {
ancestors_ = other.ancestors_;
Expand Down Expand Up @@ -3503,6 +3601,209 @@ public Builder clearServicePerimeter() {
return servicePerimeterBuilder_;
}

private com.google.cloud.osconfig.v1.Inventory osInventory_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.osconfig.v1.Inventory,
com.google.cloud.osconfig.v1.Inventory.Builder,
com.google.cloud.osconfig.v1.InventoryOrBuilder>
osInventoryBuilder_;
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*
* @return Whether the osInventory field is set.
*/
public boolean hasOsInventory() {
return osInventoryBuilder_ != null || osInventory_ != null;
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*
* @return The osInventory.
*/
public com.google.cloud.osconfig.v1.Inventory getOsInventory() {
if (osInventoryBuilder_ == null) {
return osInventory_ == null
? com.google.cloud.osconfig.v1.Inventory.getDefaultInstance()
: osInventory_;
} else {
return osInventoryBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*/
public Builder setOsInventory(com.google.cloud.osconfig.v1.Inventory value) {
if (osInventoryBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
osInventory_ = value;
onChanged();
} else {
osInventoryBuilder_.setMessage(value);
}

return this;
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*/
public Builder setOsInventory(com.google.cloud.osconfig.v1.Inventory.Builder builderForValue) {
if (osInventoryBuilder_ == null) {
osInventory_ = builderForValue.build();
onChanged();
} else {
osInventoryBuilder_.setMessage(builderForValue.build());
}

return this;
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*/
public Builder mergeOsInventory(com.google.cloud.osconfig.v1.Inventory value) {
if (osInventoryBuilder_ == null) {
if (osInventory_ != null) {
osInventory_ =
com.google.cloud.osconfig.v1.Inventory.newBuilder(osInventory_)
.mergeFrom(value)
.buildPartial();
} else {
osInventory_ = value;
}
onChanged();
} else {
osInventoryBuilder_.mergeFrom(value);
}

return this;
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*/
public Builder clearOsInventory() {
if (osInventoryBuilder_ == null) {
osInventory_ = null;
onChanged();
} else {
osInventory_ = null;
osInventoryBuilder_ = null;
}

return this;
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*/
public com.google.cloud.osconfig.v1.Inventory.Builder getOsInventoryBuilder() {

onChanged();
return getOsInventoryFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*/
public com.google.cloud.osconfig.v1.InventoryOrBuilder getOsInventoryOrBuilder() {
if (osInventoryBuilder_ != null) {
return osInventoryBuilder_.getMessageOrBuilder();
} else {
return osInventory_ == null
? com.google.cloud.osconfig.v1.Inventory.getDefaultInstance()
: osInventory_;
}
}
/**
*
*
* <pre>
* A representation of runtime OS Inventory information. See [this
* topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
* for more information.
* </pre>
*
* <code>.google.cloud.osconfig.v1.Inventory os_inventory = 12;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.osconfig.v1.Inventory,
com.google.cloud.osconfig.v1.Inventory.Builder,
com.google.cloud.osconfig.v1.InventoryOrBuilder>
getOsInventoryFieldBuilder() {
if (osInventoryBuilder_ == null) {
osInventoryBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.osconfig.v1.Inventory,
com.google.cloud.osconfig.v1.Inventory.Builder,
com.google.cloud.osconfig.v1.InventoryOrBuilder>(
getOsInventory(), getParentForChildren(), isClean());
osInventory_ = null;
}
return osInventoryBuilder_;
}

private com.google.protobuf.LazyStringList ancestors_ =
com.google.protobuf.LazyStringArrayList.EMPTY;

Expand Down

0 comments on commit 7fecc7e

Please sign in to comment.