Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.63.2 (#244)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

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] authored Feb 11, 2022
1 parent 4cf8114 commit f798ca1
Show file tree
Hide file tree
Showing 11 changed files with 888 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,26 @@ async def set_iam_policy(
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for
occurrences.
.. code-block::
from google.cloud.devtools import containeranalysis_v1
def sample_set_iam_policy():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()
# Initialize request argument(s)
request = containeranalysis_v1.SetIamPolicyRequest(
resource="resource_value",
)
# Make the request
response = client.set_iam_policy(request=request)
# Handle the response
print(response)
Args:
request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]):
The request object. Request message for `SetIamPolicy`
Expand Down Expand Up @@ -382,6 +402,26 @@ async def get_iam_policy(
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for
occurrences.
.. code-block::
from google.cloud.devtools import containeranalysis_v1
def sample_get_iam_policy():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()
# Initialize request argument(s)
request = containeranalysis_v1.GetIamPolicyRequest(
resource="resource_value",
)
# Make the request
response = client.get_iam_policy(request=request)
# Handle the response
print(response)
Args:
request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]):
The request object. Request message for `GetIamPolicy`
Expand Down Expand Up @@ -516,6 +556,27 @@ async def test_iam_permissions(
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for
occurrences.
.. code-block::
from google.cloud.devtools import containeranalysis_v1
def sample_test_iam_permissions():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()
# Initialize request argument(s)
request = containeranalysis_v1.TestIamPermissionsRequest(
resource="resource_value",
permissions=['permissions_value_1', 'permissions_value_2'],
)
# Make the request
response = client.test_iam_permissions(request=request)
# Handle the response
print(response)
Args:
request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -602,6 +663,26 @@ async def get_vulnerability_occurrences_summary(
r"""Gets a summary of the number and severity of
occurrences.
.. code-block::
from google.cloud.devtools import containeranalysis_v1
def sample_get_vulnerability_occurrences_summary():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()
# Initialize request argument(s)
request = containeranalysis_v1.GetVulnerabilityOccurrencesSummaryRequest(
parent="parent_value",
)
# Make the request
response = client.get_vulnerability_occurrences_summary(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.devtools.containeranalysis_v1.types.GetVulnerabilityOccurrencesSummaryRequest, dict]):
The request object. Request to get a vulnerability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,27 @@ def set_iam_policy(
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for
occurrences.
.. code-block::
from google.cloud.devtools import containeranalysis_v1
def sample_set_iam_policy():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()
# Initialize request argument(s)
request = containeranalysis_v1.SetIamPolicyRequest(
resource="resource_value",
)
# Make the request
response = client.set_iam_policy(request=request)
# Handle the response
print(response)
Args:
request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]):
The request object. Request message for `SetIamPolicy`
Expand Down Expand Up @@ -566,6 +587,27 @@ def get_iam_policy(
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for
occurrences.
.. code-block::
from google.cloud.devtools import containeranalysis_v1
def sample_get_iam_policy():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()
# Initialize request argument(s)
request = containeranalysis_v1.GetIamPolicyRequest(
resource="resource_value",
)
# Make the request
response = client.get_iam_policy(request=request)
# Handle the response
print(response)
Args:
request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]):
The request object. Request message for `GetIamPolicy`
Expand Down Expand Up @@ -699,6 +741,28 @@ def test_iam_permissions(
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for
occurrences.
.. code-block::
from google.cloud.devtools import containeranalysis_v1
def sample_test_iam_permissions():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()
# Initialize request argument(s)
request = containeranalysis_v1.TestIamPermissionsRequest(
resource="resource_value",
permissions=['permissions_value_1', 'permissions_value_2'],
)
# Make the request
response = client.test_iam_permissions(request=request)
# Handle the response
print(response)
Args:
request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -784,6 +848,27 @@ def get_vulnerability_occurrences_summary(
r"""Gets a summary of the number and severity of
occurrences.
.. code-block::
from google.cloud.devtools import containeranalysis_v1
def sample_get_vulnerability_occurrences_summary():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()
# Initialize request argument(s)
request = containeranalysis_v1.GetVulnerabilityOccurrencesSummaryRequest(
parent="parent_value",
)
# Make the request
response = client.get_vulnerability_occurrences_summary(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.devtools.containeranalysis_v1.types.GetVulnerabilityOccurrencesSummaryRequest, dict]):
The request object. Request to get a vulnerability
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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.
#
# Generated code. DO NOT EDIT!
#
# Snippet for GetIamPolicy
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-devtools-containeranalysis


# [START containeranalysis_generated_containeranalysis_v1_ContainerAnalysis_GetIamPolicy_async]
from google.cloud.devtools import containeranalysis_v1


async def sample_get_iam_policy():
# Create a client
client = containeranalysis_v1.ContainerAnalysisAsyncClient()

# Initialize request argument(s)
request = containeranalysis_v1.GetIamPolicyRequest(
resource="resource_value",
)

# Make the request
response = await client.get_iam_policy(request=request)

# Handle the response
print(response)

# [END containeranalysis_generated_containeranalysis_v1_ContainerAnalysis_GetIamPolicy_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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.
#
# Generated code. DO NOT EDIT!
#
# Snippet for GetIamPolicy
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-devtools-containeranalysis


# [START containeranalysis_generated_containeranalysis_v1_ContainerAnalysis_GetIamPolicy_sync]
from google.cloud.devtools import containeranalysis_v1


def sample_get_iam_policy():
# Create a client
client = containeranalysis_v1.ContainerAnalysisClient()

# Initialize request argument(s)
request = containeranalysis_v1.GetIamPolicyRequest(
resource="resource_value",
)

# Make the request
response = client.get_iam_policy(request=request)

# Handle the response
print(response)

# [END containeranalysis_generated_containeranalysis_v1_ContainerAnalysis_GetIamPolicy_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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.
#
# Generated code. DO NOT EDIT!
#
# Snippet for GetVulnerabilityOccurrencesSummary
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-devtools-containeranalysis


# [START containeranalysis_generated_containeranalysis_v1_ContainerAnalysis_GetVulnerabilityOccurrencesSummary_async]
from google.cloud.devtools import containeranalysis_v1


async def sample_get_vulnerability_occurrences_summary():
# Create a client
client = containeranalysis_v1.ContainerAnalysisAsyncClient()

# Initialize request argument(s)
request = containeranalysis_v1.GetVulnerabilityOccurrencesSummaryRequest(
parent="parent_value",
)

# Make the request
response = await client.get_vulnerability_occurrences_summary(request=request)

# Handle the response
print(response)

# [END containeranalysis_generated_containeranalysis_v1_ContainerAnalysis_GetVulnerabilityOccurrencesSummary_async]
Loading

0 comments on commit f798ca1

Please sign in to comment.