• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""Generated client library for dns version v1."""
2# NOTE: This file is autogenerated and should not be edited by hand.
3from apitools.base.py import base_api
4from samples.dns_sample.dns_v1 import dns_v1_messages as messages
5
6
7class DnsV1(base_api.BaseApiClient):
8  """Generated client library for service dns version v1."""
9
10  MESSAGES_MODULE = messages
11  BASE_URL = u'https://www.googleapis.com/dns/v1/'
12
13  _PACKAGE = u'dns'
14  _SCOPES = [u'https://www.googleapis.com/auth/cloud-platform', u'https://www.googleapis.com/auth/cloud-platform.read-only', u'https://www.googleapis.com/auth/ndev.clouddns.readonly', u'https://www.googleapis.com/auth/ndev.clouddns.readwrite']
15  _VERSION = u'v1'
16  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
17  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
18  _USER_AGENT = 'x_Tw5K8nnjoRAqULM9PFAC2b'
19  _CLIENT_CLASS_NAME = u'DnsV1'
20  _URL_VERSION = u'v1'
21  _API_KEY = None
22
23  def __init__(self, url='', credentials=None,
24               get_credentials=True, http=None, model=None,
25               log_request=False, log_response=False,
26               credentials_args=None, default_global_params=None,
27               additional_http_headers=None):
28    """Create a new dns handle."""
29    url = url or self.BASE_URL
30    super(DnsV1, self).__init__(
31        url, credentials=credentials,
32        get_credentials=get_credentials, http=http, model=model,
33        log_request=log_request, log_response=log_response,
34        credentials_args=credentials_args,
35        default_global_params=default_global_params,
36        additional_http_headers=additional_http_headers)
37    self.changes = self.ChangesService(self)
38    self.managedZones = self.ManagedZonesService(self)
39    self.projects = self.ProjectsService(self)
40    self.resourceRecordSets = self.ResourceRecordSetsService(self)
41
42  class ChangesService(base_api.BaseApiService):
43    """Service class for the changes resource."""
44
45    _NAME = u'changes'
46
47    def __init__(self, client):
48      super(DnsV1.ChangesService, self).__init__(client)
49      self._upload_configs = {
50          }
51
52    def Create(self, request, global_params=None):
53      """Atomically update the ResourceRecordSet collection.
54
55      Args:
56        request: (DnsChangesCreateRequest) input message
57        global_params: (StandardQueryParameters, default: None) global arguments
58      Returns:
59        (Change) The response message.
60      """
61      config = self.GetMethodConfig('Create')
62      return self._RunMethod(
63          config, request, global_params=global_params)
64
65    Create.method_config = lambda: base_api.ApiMethodInfo(
66        http_method=u'POST',
67        method_id=u'dns.changes.create',
68        ordered_params=[u'project', u'managedZone'],
69        path_params=[u'managedZone', u'project'],
70        query_params=[],
71        relative_path=u'projects/{project}/managedZones/{managedZone}/changes',
72        request_field=u'change',
73        request_type_name=u'DnsChangesCreateRequest',
74        response_type_name=u'Change',
75        supports_download=False,
76    )
77
78    def Get(self, request, global_params=None):
79      """Fetch the representation of an existing Change.
80
81      Args:
82        request: (DnsChangesGetRequest) input message
83        global_params: (StandardQueryParameters, default: None) global arguments
84      Returns:
85        (Change) The response message.
86      """
87      config = self.GetMethodConfig('Get')
88      return self._RunMethod(
89          config, request, global_params=global_params)
90
91    Get.method_config = lambda: base_api.ApiMethodInfo(
92        http_method=u'GET',
93        method_id=u'dns.changes.get',
94        ordered_params=[u'project', u'managedZone', u'changeId'],
95        path_params=[u'changeId', u'managedZone', u'project'],
96        query_params=[],
97        relative_path=u'projects/{project}/managedZones/{managedZone}/changes/{changeId}',
98        request_field='',
99        request_type_name=u'DnsChangesGetRequest',
100        response_type_name=u'Change',
101        supports_download=False,
102    )
103
104    def List(self, request, global_params=None):
105      """Enumerate Changes to a ResourceRecordSet collection.
106
107      Args:
108        request: (DnsChangesListRequest) input message
109        global_params: (StandardQueryParameters, default: None) global arguments
110      Returns:
111        (ChangesListResponse) The response message.
112      """
113      config = self.GetMethodConfig('List')
114      return self._RunMethod(
115          config, request, global_params=global_params)
116
117    List.method_config = lambda: base_api.ApiMethodInfo(
118        http_method=u'GET',
119        method_id=u'dns.changes.list',
120        ordered_params=[u'project', u'managedZone'],
121        path_params=[u'managedZone', u'project'],
122        query_params=[u'maxResults', u'pageToken', u'sortBy', u'sortOrder'],
123        relative_path=u'projects/{project}/managedZones/{managedZone}/changes',
124        request_field='',
125        request_type_name=u'DnsChangesListRequest',
126        response_type_name=u'ChangesListResponse',
127        supports_download=False,
128    )
129
130  class ManagedZonesService(base_api.BaseApiService):
131    """Service class for the managedZones resource."""
132
133    _NAME = u'managedZones'
134
135    def __init__(self, client):
136      super(DnsV1.ManagedZonesService, self).__init__(client)
137      self._upload_configs = {
138          }
139
140    def Create(self, request, global_params=None):
141      """Create a new ManagedZone.
142
143      Args:
144        request: (DnsManagedZonesCreateRequest) input message
145        global_params: (StandardQueryParameters, default: None) global arguments
146      Returns:
147        (ManagedZone) The response message.
148      """
149      config = self.GetMethodConfig('Create')
150      return self._RunMethod(
151          config, request, global_params=global_params)
152
153    Create.method_config = lambda: base_api.ApiMethodInfo(
154        http_method=u'POST',
155        method_id=u'dns.managedZones.create',
156        ordered_params=[u'project'],
157        path_params=[u'project'],
158        query_params=[],
159        relative_path=u'projects/{project}/managedZones',
160        request_field=u'managedZone',
161        request_type_name=u'DnsManagedZonesCreateRequest',
162        response_type_name=u'ManagedZone',
163        supports_download=False,
164    )
165
166    def Delete(self, request, global_params=None):
167      """Delete a previously created ManagedZone.
168
169      Args:
170        request: (DnsManagedZonesDeleteRequest) input message
171        global_params: (StandardQueryParameters, default: None) global arguments
172      Returns:
173        (DnsManagedZonesDeleteResponse) The response message.
174      """
175      config = self.GetMethodConfig('Delete')
176      return self._RunMethod(
177          config, request, global_params=global_params)
178
179    Delete.method_config = lambda: base_api.ApiMethodInfo(
180        http_method=u'DELETE',
181        method_id=u'dns.managedZones.delete',
182        ordered_params=[u'project', u'managedZone'],
183        path_params=[u'managedZone', u'project'],
184        query_params=[],
185        relative_path=u'projects/{project}/managedZones/{managedZone}',
186        request_field='',
187        request_type_name=u'DnsManagedZonesDeleteRequest',
188        response_type_name=u'DnsManagedZonesDeleteResponse',
189        supports_download=False,
190    )
191
192    def Get(self, request, global_params=None):
193      """Fetch the representation of an existing ManagedZone.
194
195      Args:
196        request: (DnsManagedZonesGetRequest) input message
197        global_params: (StandardQueryParameters, default: None) global arguments
198      Returns:
199        (ManagedZone) The response message.
200      """
201      config = self.GetMethodConfig('Get')
202      return self._RunMethod(
203          config, request, global_params=global_params)
204
205    Get.method_config = lambda: base_api.ApiMethodInfo(
206        http_method=u'GET',
207        method_id=u'dns.managedZones.get',
208        ordered_params=[u'project', u'managedZone'],
209        path_params=[u'managedZone', u'project'],
210        query_params=[],
211        relative_path=u'projects/{project}/managedZones/{managedZone}',
212        request_field='',
213        request_type_name=u'DnsManagedZonesGetRequest',
214        response_type_name=u'ManagedZone',
215        supports_download=False,
216    )
217
218    def List(self, request, global_params=None):
219      """Enumerate ManagedZones that have been created but not yet deleted.
220
221      Args:
222        request: (DnsManagedZonesListRequest) input message
223        global_params: (StandardQueryParameters, default: None) global arguments
224      Returns:
225        (ManagedZonesListResponse) The response message.
226      """
227      config = self.GetMethodConfig('List')
228      return self._RunMethod(
229          config, request, global_params=global_params)
230
231    List.method_config = lambda: base_api.ApiMethodInfo(
232        http_method=u'GET',
233        method_id=u'dns.managedZones.list',
234        ordered_params=[u'project'],
235        path_params=[u'project'],
236        query_params=[u'dnsName', u'maxResults', u'pageToken'],
237        relative_path=u'projects/{project}/managedZones',
238        request_field='',
239        request_type_name=u'DnsManagedZonesListRequest',
240        response_type_name=u'ManagedZonesListResponse',
241        supports_download=False,
242    )
243
244  class ProjectsService(base_api.BaseApiService):
245    """Service class for the projects resource."""
246
247    _NAME = u'projects'
248
249    def __init__(self, client):
250      super(DnsV1.ProjectsService, self).__init__(client)
251      self._upload_configs = {
252          }
253
254    def Get(self, request, global_params=None):
255      """Fetch the representation of an existing Project.
256
257      Args:
258        request: (DnsProjectsGetRequest) input message
259        global_params: (StandardQueryParameters, default: None) global arguments
260      Returns:
261        (Project) The response message.
262      """
263      config = self.GetMethodConfig('Get')
264      return self._RunMethod(
265          config, request, global_params=global_params)
266
267    Get.method_config = lambda: base_api.ApiMethodInfo(
268        http_method=u'GET',
269        method_id=u'dns.projects.get',
270        ordered_params=[u'project'],
271        path_params=[u'project'],
272        query_params=[],
273        relative_path=u'projects/{project}',
274        request_field='',
275        request_type_name=u'DnsProjectsGetRequest',
276        response_type_name=u'Project',
277        supports_download=False,
278    )
279
280  class ResourceRecordSetsService(base_api.BaseApiService):
281    """Service class for the resourceRecordSets resource."""
282
283    _NAME = u'resourceRecordSets'
284
285    def __init__(self, client):
286      super(DnsV1.ResourceRecordSetsService, self).__init__(client)
287      self._upload_configs = {
288          }
289
290    def List(self, request, global_params=None):
291      """Enumerate ResourceRecordSets that have been created but not yet deleted.
292
293      Args:
294        request: (DnsResourceRecordSetsListRequest) input message
295        global_params: (StandardQueryParameters, default: None) global arguments
296      Returns:
297        (ResourceRecordSetsListResponse) The response message.
298      """
299      config = self.GetMethodConfig('List')
300      return self._RunMethod(
301          config, request, global_params=global_params)
302
303    List.method_config = lambda: base_api.ApiMethodInfo(
304        http_method=u'GET',
305        method_id=u'dns.resourceRecordSets.list',
306        ordered_params=[u'project', u'managedZone'],
307        path_params=[u'managedZone', u'project'],
308        query_params=[u'maxResults', u'name', u'pageToken', u'type'],
309        relative_path=u'projects/{project}/managedZones/{managedZone}/rrsets',
310        request_field='',
311        request_type_name=u'DnsResourceRecordSetsListRequest',
312        response_type_name=u'ResourceRecordSetsListResponse',
313        supports_download=False,
314    )
315