Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Center: Update return type of run_asset_discovery (via synth). #8032

Merged
merged 1 commit into from
May 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions securitycenter/google/cloud/securitycenter_v1/gapic/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,22 @@ class InclusionMode(enum.IntEnum):
INCLUSION_MODE_UNSPECIFIED = 0
INCLUDE_ONLY = 1
EXCLUDE = 2


class RunAssetDiscoveryResponse(object):
class State(enum.IntEnum):
"""
The state of an asset discovery run.

Attributes:
STATE_UNSPECIFIED (int): Asset discovery run state was unspecified.
COMPLETED (int): Asset discovery run completed successfully.
SUPERSEDED (int): Asset discovery run was cancelled with tasks still pending, as another
run for the same organization was started with a higher priority.
TERMINATED (int): Asset discovery run was killed and terminated.
"""

STATE_UNSPECIFIED = 0
COMPLETED = 1
SUPERSEDED = 2
TERMINATED = 3
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
)
from google.cloud.securitycenter_v1.proto import finding_pb2
from google.cloud.securitycenter_v1.proto import organization_settings_pb2
from google.cloud.securitycenter_v1.proto import run_asset_discovery_response_pb2
from google.cloud.securitycenter_v1.proto import security_marks_pb2
from google.cloud.securitycenter_v1.proto import securitycenter_service_pb2
from google.cloud.securitycenter_v1.proto import securitycenter_service_pb2_grpc
Expand Down Expand Up @@ -444,8 +445,7 @@ def get_iam_policy(

Args:
resource (str): REQUIRED: The resource for which the policy is being requested.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
Expand Down Expand Up @@ -1648,7 +1648,7 @@ def run_asset_discovery(
return google.api_core.operation.from_gapic(
operation,
self.transport._operations_client,
empty_pb2.Empty,
run_asset_discovery_response_pb2.RunAssetDiscoveryResponse,
metadata_type=empty_pb2.Empty,
)

Expand Down Expand Up @@ -1764,8 +1764,7 @@ def set_iam_policy(

Args:
resource (str): REQUIRED: The resource for which the policy is being specified.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
policy (Union[dict, ~google.cloud.securitycenter_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The
size of the policy is limited to a few 10s of KB. An empty policy is a
valid policy but certain Cloud Platform services (such as Projects)
Expand Down Expand Up @@ -1846,8 +1845,7 @@ def test_iam_permissions(

Args:
resource (str): REQUIRED: The resource for which the policy detail is being requested.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with
wildcards (such as '*' or 'storage.*') are not allowed. For more
information see `IAM
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on 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.
//

syntax = "proto3";

package google.cloud.securitycenter.v1;

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";
option java_multiple_files = true;
option java_package = "com.google.cloud.securitycenter.v1";
option php_namespace = "Google\\Cloud\\SecurityCenter\\V1";
option ruby_package = "Google::Cloud::SecurityCenter::V1";

// Response of asset discovery run
message RunAssetDiscoveryResponse {
// The state of an asset discovery run.
enum State {
// Asset discovery run state was unspecified.
STATE_UNSPECIFIED = 0;

// Asset discovery run completed successfully.
COMPLETED = 1;

// Asset discovery run was cancelled with tasks still pending, as another
// run for the same organization was started with a higher priority.
SUPERSEDED = 2;

// Asset discovery run was killed and terminated.
TERMINATED = 3;
}

// The state of an asset discovery run.
State state = 1;

// The duration between asset discovery run start and end
google.protobuf.Duration duration = 2;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
4 changes: 4 additions & 0 deletions securitycenter/google/cloud/securitycenter_v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from google.cloud.securitycenter_v1.proto import asset_pb2
from google.cloud.securitycenter_v1.proto import finding_pb2
from google.cloud.securitycenter_v1.proto import organization_settings_pb2
from google.cloud.securitycenter_v1.proto import run_asset_discovery_response_pb2
from google.cloud.securitycenter_v1.proto import security_marks_pb2
from google.cloud.securitycenter_v1.proto import securitycenter_service_pb2
from google.cloud.securitycenter_v1.proto import source_pb2
Expand All @@ -34,6 +35,7 @@
from google.protobuf import struct_pb2
from google.protobuf import timestamp_pb2
from google.rpc import status_pb2
from google.type import expr_pb2

_shared_modules = [
iam_policy_pb2,
Expand All @@ -45,12 +47,14 @@
struct_pb2,
timestamp_pb2,
status_pb2,
expr_pb2,
]

_local_modules = [
asset_pb2,
finding_pb2,
organization_settings_pb2,
run_asset_discovery_response_pb2,
security_marks_pb2,
securitycenter_service_pb2,
source_pb2,
Expand Down
Loading