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

chore: use gapic-generator-python 0.65.2 #146

Merged
merged 2 commits into from
Apr 27, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,17 @@ async def suggest_queries(

from google.cloud import dataqna_v1alpha

def sample_suggest_queries():
async def sample_suggest_queries():
# Create a client
client = dataqna_v1alpha.AutoSuggestionServiceClient()
client = dataqna_v1alpha.AutoSuggestionServiceAsyncClient()

# Initialize request argument(s)
request = dataqna_v1alpha.SuggestQueriesRequest(
parent="parent_value",
)

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

# Handle the response
print(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,17 @@ async def get_question(

from google.cloud import dataqna_v1alpha

def sample_get_question():
async def sample_get_question():
# Create a client
client = dataqna_v1alpha.QuestionServiceClient()
client = dataqna_v1alpha.QuestionServiceAsyncClient()

# Initialize request argument(s)
request = dataqna_v1alpha.GetQuestionRequest(
name="name_value",
)

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

# Handle the response
print(response)
Expand Down Expand Up @@ -345,9 +345,9 @@ async def create_question(

from google.cloud import dataqna_v1alpha

def sample_create_question():
async def sample_create_question():
# Create a client
client = dataqna_v1alpha.QuestionServiceClient()
client = dataqna_v1alpha.QuestionServiceAsyncClient()

# Initialize request argument(s)
question = dataqna_v1alpha.Question()
Expand All @@ -360,7 +360,7 @@ def sample_create_question():
)

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

# Handle the response
print(response)
Expand Down Expand Up @@ -457,9 +457,9 @@ async def execute_question(

from google.cloud import dataqna_v1alpha

def sample_execute_question():
async def sample_execute_question():
# Create a client
client = dataqna_v1alpha.QuestionServiceClient()
client = dataqna_v1alpha.QuestionServiceAsyncClient()

# Initialize request argument(s)
request = dataqna_v1alpha.ExecuteQuestionRequest(
Expand All @@ -468,7 +468,7 @@ def sample_execute_question():
)

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

# Handle the response
print(response)
Expand Down Expand Up @@ -565,17 +565,17 @@ async def get_user_feedback(

from google.cloud import dataqna_v1alpha

def sample_get_user_feedback():
async def sample_get_user_feedback():
# Create a client
client = dataqna_v1alpha.QuestionServiceClient()
client = dataqna_v1alpha.QuestionServiceAsyncClient()

# Initialize request argument(s)
request = dataqna_v1alpha.GetUserFeedbackRequest(
name="name_value",
)

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

# Handle the response
print(response)
Expand Down Expand Up @@ -661,9 +661,9 @@ async def update_user_feedback(

from google.cloud import dataqna_v1alpha

def sample_update_user_feedback():
async def sample_update_user_feedback():
# Create a client
client = dataqna_v1alpha.QuestionServiceClient()
client = dataqna_v1alpha.QuestionServiceAsyncClient()

# Initialize request argument(s)
user_feedback = dataqna_v1alpha.UserFeedback()
Expand All @@ -674,7 +674,7 @@ def sample_update_user_feedback():
)

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

# Handle the response
print(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ def test_suggest_queries_field_headers():
# a field header. Set these to a non-empty value.
request = auto_suggestion_service.SuggestQueriesRequest()

request.parent = "parent/value"
request.parent = "parent_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.suggest_queries), "__call__") as call:
Expand All @@ -774,7 +774,7 @@ def test_suggest_queries_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"parent=parent/value",
"parent=parent_value",
) in kw["metadata"]


Expand All @@ -788,7 +788,7 @@ async def test_suggest_queries_field_headers_async():
# a field header. Set these to a non-empty value.
request = auto_suggestion_service.SuggestQueriesRequest()

request.parent = "parent/value"
request.parent = "parent_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.suggest_queries), "__call__") as call:
Expand All @@ -806,7 +806,7 @@ async def test_suggest_queries_field_headers_async():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"parent=parent/value",
"parent=parent_value",
) in kw["metadata"]


Expand Down
40 changes: 20 additions & 20 deletions tests/unit/gapic/dataqna_v1alpha/test_question_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ def test_get_question_field_headers():
# a field header. Set these to a non-empty value.
request = question_service.GetQuestionRequest()

request.name = "name/value"
request.name = "name_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.get_question), "__call__") as call:
Expand All @@ -795,7 +795,7 @@ def test_get_question_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand All @@ -809,7 +809,7 @@ async def test_get_question_field_headers_async():
# a field header. Set these to a non-empty value.
request = question_service.GetQuestionRequest()

request.name = "name/value"
request.name = "name_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.get_question), "__call__") as call:
Expand All @@ -825,7 +825,7 @@ async def test_get_question_field_headers_async():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand Down Expand Up @@ -1023,7 +1023,7 @@ def test_create_question_field_headers():
# a field header. Set these to a non-empty value.
request = question_service.CreateQuestionRequest()

request.parent = "parent/value"
request.parent = "parent_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.create_question), "__call__") as call:
Expand All @@ -1039,7 +1039,7 @@ def test_create_question_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"parent=parent/value",
"parent=parent_value",
) in kw["metadata"]


Expand All @@ -1053,7 +1053,7 @@ async def test_create_question_field_headers_async():
# a field header. Set these to a non-empty value.
request = question_service.CreateQuestionRequest()

request.parent = "parent/value"
request.parent = "parent_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.create_question), "__call__") as call:
Expand All @@ -1071,7 +1071,7 @@ async def test_create_question_field_headers_async():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"parent=parent/value",
"parent=parent_value",
) in kw["metadata"]


Expand Down Expand Up @@ -1282,7 +1282,7 @@ def test_execute_question_field_headers():
# a field header. Set these to a non-empty value.
request = question_service.ExecuteQuestionRequest()

request.name = "name/value"
request.name = "name_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.execute_question), "__call__") as call:
Expand All @@ -1298,7 +1298,7 @@ def test_execute_question_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand All @@ -1312,7 +1312,7 @@ async def test_execute_question_field_headers_async():
# a field header. Set these to a non-empty value.
request = question_service.ExecuteQuestionRequest()

request.name = "name/value"
request.name = "name_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.execute_question), "__call__") as call:
Expand All @@ -1328,7 +1328,7 @@ async def test_execute_question_field_headers_async():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand Down Expand Up @@ -1535,7 +1535,7 @@ def test_get_user_feedback_field_headers():
# a field header. Set these to a non-empty value.
request = question_service.GetUserFeedbackRequest()

request.name = "name/value"
request.name = "name_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
Expand All @@ -1553,7 +1553,7 @@ def test_get_user_feedback_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand All @@ -1567,7 +1567,7 @@ async def test_get_user_feedback_field_headers_async():
# a field header. Set these to a non-empty value.
request = question_service.GetUserFeedbackRequest()

request.name = "name/value"
request.name = "name_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
Expand All @@ -1587,7 +1587,7 @@ async def test_get_user_feedback_field_headers_async():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand Down Expand Up @@ -1790,7 +1790,7 @@ def test_update_user_feedback_field_headers():
# a field header. Set these to a non-empty value.
request = question_service.UpdateUserFeedbackRequest()

request.user_feedback.name = "user_feedback.name/value"
request.user_feedback.name = "name_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
Expand All @@ -1808,7 +1808,7 @@ def test_update_user_feedback_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"user_feedback.name=user_feedback.name/value",
"user_feedback.name=name_value",
) in kw["metadata"]


Expand All @@ -1822,7 +1822,7 @@ async def test_update_user_feedback_field_headers_async():
# a field header. Set these to a non-empty value.
request = question_service.UpdateUserFeedbackRequest()

request.user_feedback.name = "user_feedback.name/value"
request.user_feedback.name = "name_value"

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
Expand All @@ -1842,7 +1842,7 @@ async def test_update_user_feedback_field_headers_async():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"user_feedback.name=user_feedback.name/value",
"user_feedback.name=name_value",
) in kw["metadata"]


Expand Down