This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
/
base.py
150 lines (127 loc) · 4.6 KB
/
base.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# -*- 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.
#
import abc
import typing
from google import auth
from google.api_core import operations_v1 # type: ignore
from google.auth import credentials # type: ignore
from google.cloud.gaming_v1.types import game_server_deployments
from google.longrunning import operations_pb2 as operations # type: ignore
class GameServerDeploymentsServiceTransport(metaclass=abc.ABCMeta):
"""Abstract transport class for GameServerDeploymentsService."""
AUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",)
def __init__(
self,
*,
host: str = "gameservices.googleapis.com",
credentials: credentials.Credentials = None,
) -> None:
"""Instantiate the transport.
Args:
host (Optional[str]): The hostname to connect to.
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
"""
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
self._host = host
# If no credentials are provided, then determine the appropriate
# defaults.
if credentials is None:
credentials, _ = auth.default(scopes=self.AUTH_SCOPES)
# Save the credentials.
self._credentials = credentials
@property
def operations_client(self) -> operations_v1.OperationsClient:
"""Return the client designed to process long-running operations."""
raise NotImplementedError
@property
def list_game_server_deployments(
self
) -> typing.Callable[
[game_server_deployments.ListGameServerDeploymentsRequest],
game_server_deployments.ListGameServerDeploymentsResponse,
]:
raise NotImplementedError
@property
def get_game_server_deployment(
self
) -> typing.Callable[
[game_server_deployments.GetGameServerDeploymentRequest],
game_server_deployments.GameServerDeployment,
]:
raise NotImplementedError
@property
def create_game_server_deployment(
self
) -> typing.Callable[
[game_server_deployments.CreateGameServerDeploymentRequest],
operations.Operation,
]:
raise NotImplementedError
@property
def delete_game_server_deployment(
self
) -> typing.Callable[
[game_server_deployments.DeleteGameServerDeploymentRequest],
operations.Operation,
]:
raise NotImplementedError
@property
def update_game_server_deployment(
self
) -> typing.Callable[
[game_server_deployments.UpdateGameServerDeploymentRequest],
operations.Operation,
]:
raise NotImplementedError
@property
def get_game_server_deployment_rollout(
self
) -> typing.Callable[
[game_server_deployments.GetGameServerDeploymentRolloutRequest],
game_server_deployments.GameServerDeploymentRollout,
]:
raise NotImplementedError
@property
def update_game_server_deployment_rollout(
self
) -> typing.Callable[
[game_server_deployments.UpdateGameServerDeploymentRolloutRequest],
operations.Operation,
]:
raise NotImplementedError
@property
def preview_game_server_deployment_rollout(
self
) -> typing.Callable[
[game_server_deployments.PreviewGameServerDeploymentRolloutRequest],
game_server_deployments.PreviewGameServerDeploymentRolloutResponse,
]:
raise NotImplementedError
@property
def fetch_deployment_state(
self
) -> typing.Callable[
[game_server_deployments.FetchDeploymentStateRequest],
game_server_deployments.FetchDeploymentStateResponse,
]:
raise NotImplementedError
__all__ = ("GameServerDeploymentsServiceTransport",)