1# -*- coding: utf-8 -*- #
2# Copyright 2015 Google LLC. All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#    http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15"""Resource definitions for cloud platform apis."""
16
17import enum
18
19
20BASE_URL = 'https://pubsub.googleapis.com/v1/'
21DOCS_URL = 'https://cloud.google.com/pubsub/docs'
22
23
24class Collections(enum.Enum):
25  """Collections for all supported apis."""
26
27  PROJECTS = (
28      'projects',
29      'projects/{projectsId}',
30      {},
31      ['projectsId'],
32      True
33  )
34  PROJECTS_SCHEMAS = (
35      'projects.schemas',
36      '{+name}',
37      {
38          '':
39              'projects/{projectsId}/schemas/{schemasId}',
40      },
41      ['name'],
42      True
43  )
44  PROJECTS_SNAPSHOTS = (
45      'projects.snapshots',
46      '{+snapshot}',
47      {
48          '':
49              'projects/{projectsId}/snapshots/{snapshotsId}',
50      },
51      ['snapshot'],
52      True
53  )
54  PROJECTS_SUBSCRIPTIONS = (
55      'projects.subscriptions',
56      '{+subscription}',
57      {
58          '':
59              'projects/{projectsId}/subscriptions/{subscriptionsId}',
60      },
61      ['subscription'],
62      True
63  )
64  PROJECTS_TOPICS = (
65      'projects.topics',
66      '{+topic}',
67      {
68          '':
69              'projects/{projectsId}/topics/{topicsId}',
70      },
71      ['topic'],
72      True
73  )
74
75  def __init__(self, collection_name, path, flat_paths, params,
76               enable_uri_parsing):
77    self.collection_name = collection_name
78    self.path = path
79    self.flat_paths = flat_paths
80    self.params = params
81    self.enable_uri_parsing = enable_uri_parsing
82