Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mihirvala-crestdata committed Mar 11, 2025
1 parent ec513e8 commit 273d12d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions model_armor/snippets/list_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,24 @@ def list_model_armor_templates(
"""
# [START modelarmor_list_templates]
from google.api_core.client_options import ClientOptions
from google.cloud.modelarmor_v1 import (
ModelArmorClient,
ListTemplatesRequest,
)
from google.cloud import modelarmor_v1

# TODO(Developer): Uncomment these variables.
# project_id = "YOUR_PROJECT_ID"
# location = "us-central1"

# Create the Model Armor client.
client = ModelArmorClient(
client = modelarmor_v1.ModelArmorClient(
transport="rest",
client_options=ClientOptions(
api_endpoint=f"modelarmor.{location}.rep.googleapis.com"
),
)

# Initialize request argument(s).
request = ListTemplatesRequest(parent=f"projects/{project_id}/locations/{location}")
request = modelarmor_v1.ListTemplatesRequest(
parent=f"projects/{project_id}/locations/{location}"
)

# Get list of templates.
response = client.list_templates(request=request)
Expand Down

0 comments on commit 273d12d

Please sign in to comment.