Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a6510de
chore: Set `rest_numeric_enums = False` for all gapic rules explicitly
gcf-owl-bot[bot] Nov 2, 2022
84ff5dc
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Nov 2, 2022
4c91317
chore: include generated samples dir for all google apis
gcf-owl-bot[bot] Nov 2, 2022
5868867
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Nov 2, 2022
b4ec8f9
chore: Enable requesting numeric enums in "transport=rest" responses …
gcf-owl-bot[bot] Dec 6, 2022
1718577
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Dec 6, 2022
13a36eb
chore(bazel): update protobuf to v3.21.12
gcf-owl-bot[bot] Jan 20, 2023
138e1d6
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 20, 2023
dff6194
chore: update import paths for Go targets to match open source location
gcf-owl-bot[bot] Feb 3, 2023
459adf5
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 3, 2023
ba41080
Merge branch 'main' into owl-bot-copy
Shabirmean Feb 7, 2023
c1f8da0
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 7, 2023
002daf1
fix: Add service_yaml_parameters to `java_gapic_library` targets
gcf-owl-bot[bot] Mar 10, 2023
a6c51a5
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 10, 2023
5fb43ca
chore(deps): Update gapic-generator-java to 2.15.3
gcf-owl-bot[bot] Mar 15, 2023
daa589a
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 15, 2023
6c71524
chore(deps): Update gapic-generator-java to 2.16.0
gcf-owl-bot[bot] Mar 29, 2023
c96bd9a
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 29, 2023
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-network-security</artifactId>
<version>0.8.0</version>
<version>0.16.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-network-security:0.8.0'
implementation 'com.google.cloud:google-cloud-network-security:0.16.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-network-security" % "0.8.0"
libraryDependencies += "com.google.cloud" % "google-cloud-network-security" % "0.16.0"
```

## Authentication
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse;
import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse;
import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListLocationsPagedResponse;
import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse;

import com.google.api.core.ApiFunction;
Expand All @@ -32,7 +33,16 @@
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.cloud.networksecurity.v1.stub.NetworkSecurityStubSettings;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import java.io.IOException;
Expand Down Expand Up @@ -244,6 +254,33 @@ public class NetworkSecuritySettings extends ClientSettings<NetworkSecuritySetti
.deleteClientTlsPolicyOperationSettings();
}

/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
return ((NetworkSecurityStubSettings) getStubSettings()).listLocationsSettings();
}

/** Returns the object with the settings used for calls to getLocation. */
public UnaryCallSettings<GetLocationRequest, Location> getLocationSettings() {
return ((NetworkSecurityStubSettings) getStubSettings()).getLocationSettings();
}

/** Returns the object with the settings used for calls to setIamPolicy. */
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return ((NetworkSecurityStubSettings) getStubSettings()).setIamPolicySettings();
}

/** Returns the object with the settings used for calls to getIamPolicy. */
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return ((NetworkSecurityStubSettings) getStubSettings()).getIamPolicySettings();
}

/** Returns the object with the settings used for calls to testIamPermissions. */
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsSettings() {
return ((NetworkSecurityStubSettings) getStubSettings()).testIamPermissionsSettings();
}

public static final NetworkSecuritySettings create(NetworkSecurityStubSettings stub)
throws IOException {
return new NetworkSecuritySettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -500,6 +537,34 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().deleteClientTlsPolicyOperationSettings();
}

/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
return getStubSettingsBuilder().listLocationsSettings();
}

/** Returns the builder for the settings used for calls to getLocation. */
public UnaryCallSettings.Builder<GetLocationRequest, Location> getLocationSettings() {
return getStubSettingsBuilder().getLocationSettings();
}

/** Returns the builder for the settings used for calls to setIamPolicy. */
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return getStubSettingsBuilder().setIamPolicySettings();
}

/** Returns the builder for the settings used for calls to getIamPolicy. */
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return getStubSettingsBuilder().getIamPolicySettings();
}

/** Returns the builder for the settings used for calls to testIamPermissions. */
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsSettings() {
return getStubSettingsBuilder().testIamPermissionsSettings();
}

@Override
public NetworkSecuritySettings build() throws IOException {
return new NetworkSecuritySettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
"GetClientTlsPolicy": {
"methods": ["getClientTlsPolicy", "getClientTlsPolicy", "getClientTlsPolicy", "getClientTlsPolicyCallable"]
},
"GetIamPolicy": {
"methods": ["getIamPolicy", "getIamPolicyCallable"]
},
"GetLocation": {
"methods": ["getLocation", "getLocationCallable"]
},
"GetServerTlsPolicy": {
"methods": ["getServerTlsPolicy", "getServerTlsPolicy", "getServerTlsPolicy", "getServerTlsPolicyCallable"]
},
Expand All @@ -43,9 +49,18 @@
"ListClientTlsPolicies": {
"methods": ["listClientTlsPolicies", "listClientTlsPolicies", "listClientTlsPolicies", "listClientTlsPoliciesPagedCallable", "listClientTlsPoliciesCallable"]
},
"ListLocations": {
"methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
},
"ListServerTlsPolicies": {
"methods": ["listServerTlsPolicies", "listServerTlsPolicies", "listServerTlsPolicies", "listServerTlsPoliciesPagedCallable", "listServerTlsPoliciesCallable"]
},
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
"TestIamPermissions": {
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
},
"UpdateAuthorizationPolicy": {
"methods": ["updateAuthorizationPolicyAsync", "updateAuthorizationPolicyAsync", "updateAuthorizationPolicyOperationCallable", "updateAuthorizationPolicyCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/

/**
* The interfaces provided are listed below, along with usage samples.
* A client to Network Security API
*
* <p>The interfaces provided are listed below, along with usage samples.
*
* <p>======================= NetworkSecurityClient =======================
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse;
import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse;
import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListLocationsPagedResponse;
import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse;

import com.google.api.gax.core.BackgroundResource;
Expand All @@ -27,6 +28,10 @@
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.cloud.networksecurity.v1.AuthorizationPolicy;
import com.google.cloud.networksecurity.v1.ClientTlsPolicy;
import com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest;
Expand All @@ -50,6 +55,11 @@
import com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest;
import com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest;
import com.google.common.collect.ImmutableMap;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
Expand Down Expand Up @@ -238,6 +248,52 @@ public class GrpcNetworkSecurityStub extends NetworkSecurityStub {
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();

private static final MethodDescriptor<ListLocationsRequest, ListLocationsResponse>
listLocationsMethodDescriptor =
MethodDescriptor.<ListLocationsRequest, ListLocationsResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.location.Locations/ListLocations")
.setRequestMarshaller(
ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<GetLocationRequest, Location> getLocationMethodDescriptor =
MethodDescriptor.<GetLocationRequest, Location>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.location.Locations/GetLocation")
.setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance()))
.build();

private static final MethodDescriptor<SetIamPolicyRequest, Policy> setIamPolicyMethodDescriptor =
MethodDescriptor.<SetIamPolicyRequest, Policy>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();

private static final MethodDescriptor<GetIamPolicyRequest, Policy> getIamPolicyMethodDescriptor =
MethodDescriptor.<GetIamPolicyRequest, Policy>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();

private static final MethodDescriptor<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsMethodDescriptor =
MethodDescriptor.<TestIamPermissionsRequest, TestIamPermissionsResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions")
.setRequestMarshaller(
ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance()))
.build();

private final UnaryCallable<ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesResponse>
listAuthorizationPoliciesCallable;
private final UnaryCallable<
Expand Down Expand Up @@ -295,6 +351,14 @@ public class GrpcNetworkSecurityStub extends NetworkSecurityStub {
deleteClientTlsPolicyCallable;
private final OperationCallable<DeleteClientTlsPolicyRequest, Empty, OperationMetadata>
deleteClientTlsPolicyOperationCallable;
private final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable;
private final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable;
private final UnaryCallable<GetLocationRequest, Location> getLocationCallable;
private final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable;
private final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable;
private final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsCallable;

private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
Expand Down Expand Up @@ -514,6 +578,57 @@ protected GrpcNetworkSecurityStub(
return params.build();
})
.build();
GrpcCallSettings<ListLocationsRequest, ListLocationsResponse> listLocationsTransportSettings =
GrpcCallSettings.<ListLocationsRequest, ListLocationsResponse>newBuilder()
.setMethodDescriptor(listLocationsMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<GetLocationRequest, Location> getLocationTransportSettings =
GrpcCallSettings.<GetLocationRequest, Location>newBuilder()
.setMethodDescriptor(getLocationMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<SetIamPolicyRequest, Policy> setIamPolicyTransportSettings =
GrpcCallSettings.<SetIamPolicyRequest, Policy>newBuilder()
.setMethodDescriptor(setIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("resource", String.valueOf(request.getResource()));
return params.build();
})
.build();
GrpcCallSettings<GetIamPolicyRequest, Policy> getIamPolicyTransportSettings =
GrpcCallSettings.<GetIamPolicyRequest, Policy>newBuilder()
.setMethodDescriptor(getIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("resource", String.valueOf(request.getResource()));
return params.build();
})
.build();
GrpcCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsTransportSettings =
GrpcCallSettings.<TestIamPermissionsRequest, TestIamPermissionsResponse>newBuilder()
.setMethodDescriptor(testIamPermissionsMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("resource", String.valueOf(request.getResource()));
return params.build();
})
.build();

this.listAuthorizationPoliciesCallable =
callableFactory.createUnaryCallable(
Expand Down Expand Up @@ -659,6 +774,26 @@ protected GrpcNetworkSecurityStub(
settings.deleteClientTlsPolicyOperationSettings(),
clientContext,
operationsStub);
this.listLocationsCallable =
callableFactory.createUnaryCallable(
listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
this.listLocationsPagedCallable =
callableFactory.createPagedCallable(
listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
this.getLocationCallable =
callableFactory.createUnaryCallable(
getLocationTransportSettings, settings.getLocationSettings(), clientContext);
this.setIamPolicyCallable =
callableFactory.createUnaryCallable(
setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext);
this.getIamPolicyCallable =
callableFactory.createUnaryCallable(
getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
this.testIamPermissionsCallable =
callableFactory.createUnaryCallable(
testIamPermissionsTransportSettings,
settings.testIamPermissionsSettings(),
clientContext);

this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
Expand Down Expand Up @@ -822,6 +957,38 @@ public UnaryCallable<DeleteClientTlsPolicyRequest, Operation> deleteClientTlsPol
return deleteClientTlsPolicyOperationCallable;
}

@Override
public UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
return listLocationsCallable;
}

@Override
public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable() {
return listLocationsPagedCallable;
}

@Override
public UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
return getLocationCallable;
}

@Override
public UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
return setIamPolicyCallable;
}

@Override
public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
return getIamPolicyCallable;
}

@Override
public UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsCallable() {
return testIamPermissionsCallable;
}

@Override
public final void close() {
try {
Expand Down
Loading