google-api-client 0.9.20 → 0.9.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +8 -4
  3. data/api_names.yaml +33179 -1058
  4. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  5. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  6. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +24 -6
  7. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +2 -0
  8. data/generated/google/apis/admin_directory_v1.rb +1 -1
  9. data/generated/google/apis/admin_directory_v1/classes.rb +14 -0
  10. data/generated/google/apis/admin_directory_v1/representations.rb +2 -0
  11. data/generated/google/apis/adsense_v1_4.rb +1 -1
  12. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  13. data/generated/google/apis/analyticsreporting_v4.rb +1 -1
  14. data/generated/google/apis/analyticsreporting_v4/classes.rb +7 -0
  15. data/generated/google/apis/analyticsreporting_v4/representations.rb +1 -0
  16. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  17. data/generated/google/apis/androidenterprise_v1/classes.rb +96 -156
  18. data/generated/google/apis/androidenterprise_v1/representations.rb +18 -47
  19. data/generated/google/apis/androidenterprise_v1/service.rb +15 -459
  20. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  21. data/generated/google/apis/androidpublisher_v2/classes.rb +176 -0
  22. data/generated/google/apis/androidpublisher_v2/representations.rb +62 -0
  23. data/generated/google/apis/androidpublisher_v2/service.rb +60 -2
  24. data/generated/google/apis/appengine_v1beta5.rb +1 -1
  25. data/generated/google/apis/appengine_v1beta5/classes.rb +300 -198
  26. data/generated/google/apis/appengine_v1beta5/representations.rb +36 -0
  27. data/generated/google/apis/appengine_v1beta5/service.rb +54 -49
  28. data/generated/google/apis/appsactivity_v1.rb +1 -1
  29. data/generated/google/apis/appstate_v1.rb +1 -1
  30. data/generated/google/apis/bigquery_v2.rb +1 -1
  31. data/generated/google/apis/bigquery_v2/classes.rb +50 -6
  32. data/generated/google/apis/bigquery_v2/representations.rb +5 -0
  33. data/generated/google/apis/books_v1.rb +1 -1
  34. data/generated/google/apis/books_v1/classes.rb +7 -2
  35. data/generated/google/apis/books_v1/representations.rb +1 -0
  36. data/generated/google/apis/calendar_v3.rb +1 -1
  37. data/generated/google/apis/classroom_v1.rb +1 -1
  38. data/generated/google/apis/classroom_v1/classes.rb +74 -74
  39. data/generated/google/apis/classroom_v1/representations.rb +29 -29
  40. data/generated/google/apis/classroom_v1/service.rb +132 -28
  41. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  42. data/generated/google/apis/cloudbuild_v1/classes.rb +47 -27
  43. data/generated/google/apis/cloudbuild_v1/representations.rb +20 -7
  44. data/generated/google/apis/cloudbuild_v1/service.rb +42 -0
  45. data/generated/google/apis/clouddebugger_v2.rb +1 -1
  46. data/generated/google/apis/clouddebugger_v2/classes.rb +648 -578
  47. data/generated/google/apis/clouddebugger_v2/representations.rb +140 -140
  48. data/generated/google/apis/clouddebugger_v2/service.rb +161 -155
  49. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  50. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +563 -423
  51. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +116 -76
  52. data/generated/google/apis/cloudresourcemanager_v1/service.rb +318 -249
  53. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  54. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +396 -331
  55. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +79 -79
  56. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +317 -281
  57. data/generated/google/apis/compute_beta.rb +1 -1
  58. data/generated/google/apis/compute_beta/classes.rb +352 -80
  59. data/generated/google/apis/compute_beta/representations.rb +132 -19
  60. data/generated/google/apis/compute_beta/service.rb +214 -0
  61. data/generated/google/apis/compute_v1.rb +1 -1
  62. data/generated/google/apis/compute_v1/classes.rb +673 -73
  63. data/generated/google/apis/compute_v1/representations.rb +274 -9
  64. data/generated/google/apis/compute_v1/service.rb +1574 -2
  65. data/generated/google/apis/content_v2.rb +1 -1
  66. data/generated/google/apis/content_v2/classes.rb +7 -8
  67. data/generated/google/apis/content_v2/service.rb +125 -54
  68. data/generated/google/apis/dataflow_v1b3.rb +2 -3
  69. data/generated/google/apis/dataflow_v1b3/classes.rb +286 -114
  70. data/generated/google/apis/dataflow_v1b3/representations.rb +73 -0
  71. data/generated/google/apis/dataflow_v1b3/service.rb +37 -38
  72. data/generated/google/apis/datastore_v1.rb +1 -1
  73. data/generated/google/apis/datastore_v1/classes.rb +5 -0
  74. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  75. data/generated/google/apis/deploymentmanager_v2/classes.rb +37 -5
  76. data/generated/google/apis/deploymentmanager_v2/representations.rb +16 -0
  77. data/generated/google/apis/deploymentmanager_v2/service.rb +4 -1
  78. data/generated/google/apis/dns_v1.rb +1 -1
  79. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  80. data/generated/google/apis/drive_v2.rb +1 -1
  81. data/generated/google/apis/drive_v2/classes.rb +55 -21
  82. data/generated/google/apis/drive_v2/representations.rb +2 -0
  83. data/generated/google/apis/drive_v3.rb +1 -1
  84. data/generated/google/apis/drive_v3/classes.rb +41 -12
  85. data/generated/google/apis/drive_v3/representations.rb +2 -0
  86. data/generated/google/apis/fitness_v1.rb +31 -1
  87. data/generated/google/apis/fitness_v1/classes.rb +1 -1
  88. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  89. data/generated/google/apis/games_management_v1management.rb +1 -1
  90. data/generated/google/apis/games_v1.rb +1 -1
  91. data/generated/google/apis/gmail_v1.rb +1 -1
  92. data/generated/google/apis/gmail_v1/classes.rb +32 -1
  93. data/generated/google/apis/gmail_v1/representations.rb +15 -0
  94. data/generated/google/apis/gmail_v1/service.rb +41 -2
  95. data/generated/google/apis/identitytoolkit_v3.rb +4 -1
  96. data/generated/google/apis/identitytoolkit_v3/classes.rb +7 -0
  97. data/generated/google/apis/identitytoolkit_v3/representations.rb +1 -0
  98. data/generated/google/apis/kgsearch_v1.rb +2 -3
  99. data/generated/google/apis/kgsearch_v1/classes.rb +10 -10
  100. data/generated/google/apis/kgsearch_v1/representations.rb +2 -2
  101. data/generated/google/apis/kgsearch_v1/service.rb +28 -26
  102. data/generated/google/apis/language_v1beta1.rb +1 -1
  103. data/generated/google/apis/language_v1beta1/classes.rb +166 -8
  104. data/generated/google/apis/language_v1beta1/representations.rb +50 -0
  105. data/generated/google/apis/language_v1beta1/service.rb +32 -0
  106. data/generated/google/apis/logging_v2beta1.rb +6 -6
  107. data/generated/google/apis/logging_v2beta1/classes.rb +868 -789
  108. data/generated/google/apis/logging_v2beta1/representations.rb +179 -147
  109. data/generated/google/apis/logging_v2beta1/service.rb +378 -211
  110. data/generated/google/apis/monitoring_v3.rb +1 -1
  111. data/generated/google/apis/monitoring_v3/classes.rb +110 -112
  112. data/generated/google/apis/monitoring_v3/service.rb +68 -73
  113. data/generated/google/apis/pagespeedonline_v2.rb +1 -1
  114. data/generated/google/apis/plus_domains_v1.rb +1 -1
  115. data/generated/google/apis/plus_v1.rb +1 -1
  116. data/generated/google/apis/pubsub_v1.rb +1 -1
  117. data/generated/google/apis/pubsub_v1/classes.rb +380 -327
  118. data/generated/google/apis/pubsub_v1/representations.rb +79 -79
  119. data/generated/google/apis/pubsub_v1/service.rb +424 -396
  120. data/generated/google/apis/sheets_v4.rb +1 -1
  121. data/generated/google/apis/sheets_v4/classes.rb +175 -53
  122. data/generated/google/apis/sheets_v4/representations.rb +48 -13
  123. data/generated/google/apis/site_verification_v1.rb +1 -1
  124. data/generated/google/apis/slides_v1.rb +1 -1
  125. data/generated/google/apis/slides_v1/classes.rb +149 -31
  126. data/generated/google/apis/slides_v1/representations.rb +52 -9
  127. data/generated/google/apis/slides_v1/service.rb +5 -5
  128. data/generated/google/apis/speech_v1beta1.rb +1 -1
  129. data/generated/google/apis/speech_v1beta1/service.rb +3 -1
  130. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  131. data/generated/google/apis/sqladmin_v1beta4/classes.rb +54 -2
  132. data/generated/google/apis/sqladmin_v1beta4/representations.rb +29 -0
  133. data/generated/google/apis/sqladmin_v1beta4/service.rb +41 -0
  134. data/generated/google/apis/storage_v1.rb +1 -1
  135. data/generated/google/apis/storage_v1/classes.rb +7 -0
  136. data/generated/google/apis/storage_v1/representations.rb +2 -0
  137. data/generated/google/apis/tagmanager_v1.rb +5 -5
  138. data/generated/google/apis/vision_v1.rb +1 -1
  139. data/generated/google/apis/vision_v1/classes.rb +63 -59
  140. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  141. data/generated/google/apis/youtube_analytics_v1/classes.rb +0 -209
  142. data/generated/google/apis/youtube_analytics_v1/representations.rb +0 -99
  143. data/generated/google/apis/youtube_analytics_v1/service.rb +0 -76
  144. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  145. data/generated/google/apis/youtube_partner_v1/classes.rb +71 -0
  146. data/generated/google/apis/youtube_partner_v1/representations.rb +33 -0
  147. data/generated/google/apis/youtube_partner_v1/service.rb +52 -0
  148. data/generated/google/apis/youtube_v3.rb +1 -1
  149. data/generated/google/apis/youtube_v3/classes.rb +15 -2
  150. data/generated/google/apis/youtube_v3/representations.rb +3 -0
  151. data/generated/google/apis/youtube_v3/service.rb +4 -4
  152. data/generated/google/apis/youtubereporting_v1.rb +4 -4
  153. data/generated/google/apis/youtubereporting_v1/classes.rb +146 -137
  154. data/generated/google/apis/youtubereporting_v1/representations.rb +33 -33
  155. data/generated/google/apis/youtubereporting_v1/service.rb +149 -145
  156. data/lib/google/apis/version.rb +1 -1
  157. data/samples/cli/lib/samples/calendar.rb +1 -1
  158. data/samples/cli/lib/samples/gmail.rb +74 -0
  159. metadata +29 -29
@@ -32,28 +32,29 @@ module Google
32
32
  #
33
33
  # @see https://cloud.google.com/logging/docs/
34
34
  class LoggingService < Google::Apis::Core::BaseService
35
- # @return [String]
36
- # API key. Your API key identifies your project and provides you with API access,
37
- # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
- attr_accessor :key
39
-
40
35
  # @return [String]
41
36
  # Available to use for quota purposes for server-side applications. Can be any
42
37
  # arbitrary string assigned to a user, but should not exceed 40 characters.
43
38
  attr_accessor :quota_user
44
39
 
40
+ # @return [String]
41
+ # API key. Your API key identifies your project and provides you with API access,
42
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
43
+ attr_accessor :key
44
+
45
45
  def initialize
46
46
  super('https://logging.googleapis.com/', '')
47
47
  end
48
48
 
49
- # Creates or updates a logs-based metric.
50
- # @param [String] metric_name
51
- # The resource name of the metric to update.
52
- # Example: `"projects/my-project-id/metrics/my-metric-id"`.
53
- # The updated metric must be provided in the request and have the
54
- # same identifier that is specified in `metricName`.
55
- # If the metric does not exist, it is created.
56
- # @param [Google::Apis::LoggingV2beta1::LogMetric] log_metric_object
49
+ # Deletes all the log entries in a log. The log reappears if it receives new
50
+ # entries.
51
+ # @param [String] log_name
52
+ # Required. The resource name of the log to delete:
53
+ # "projects/[PROJECT_ID]/logs/[LOG_ID]"
54
+ # "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
55
+ # [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog"
56
+ # , "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%
57
+ # 2Factivity". For more information about log names, see LogEntry.
57
58
  # @param [String] quota_user
58
59
  # Available to use for quota purposes for server-side applications. Can be any
59
60
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -63,30 +64,138 @@ module Google
63
64
  # Request-specific options
64
65
  #
65
66
  # @yield [result, err] Result & error if block supplied
66
- # @yieldparam result [Google::Apis::LoggingV2beta1::LogMetric] parsed result object
67
+ # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
67
68
  # @yieldparam err [StandardError] error object if request failed
68
69
  #
69
- # @return [Google::Apis::LoggingV2beta1::LogMetric]
70
+ # @return [Google::Apis::LoggingV2beta1::Empty]
70
71
  #
71
72
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
72
73
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
73
74
  # @raise [Google::Apis::AuthorizationError] Authorization is required
74
- def update_project_metric(metric_name, log_metric_object = nil, quota_user: nil, fields: nil, options: nil, &block)
75
- command = make_simple_command(:put, 'v2beta1/{+metricName}', options)
76
- command.request_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
77
- command.request_object = log_metric_object
78
- command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
79
- command.response_class = Google::Apis::LoggingV2beta1::LogMetric
80
- command.params['metricName'] = metric_name unless metric_name.nil?
75
+ def delete_organization_log(log_name, quota_user: nil, fields: nil, options: nil, &block)
76
+ command = make_simple_command(:delete, 'v2beta1/{+logName}', options)
77
+ command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
78
+ command.response_class = Google::Apis::LoggingV2beta1::Empty
79
+ command.params['logName'] = log_name unless log_name.nil?
81
80
  command.query['quotaUser'] = quota_user unless quota_user.nil?
82
81
  command.query['fields'] = fields unless fields.nil?
83
82
  execute_or_queue_command(command, &block)
84
83
  end
85
84
 
86
- # Gets a logs-based metric.
85
+ # Lists the logs in projects or organizations. Only logs that have entries are
86
+ # listed.
87
+ # @param [String] parent
88
+ # Required. The resource name that owns the logs:
89
+ # "projects/[PROJECT_ID]"
90
+ # "organizations/[ORGANIZATION_ID]"
91
+ # @param [Fixnum] page_size
92
+ # Optional. The maximum number of results to return from this request. Non-
93
+ # positive values are ignored. The presence of nextPageToken in the response
94
+ # indicates that more results might be available.
95
+ # @param [String] page_token
96
+ # Optional. If present, then retrieve the next batch of results from the
97
+ # preceding call to this method. pageToken must be the value of nextPageToken
98
+ # from the previous response. The values of other method parameters should be
99
+ # identical to those in the previous call.
100
+ # @param [String] quota_user
101
+ # Available to use for quota purposes for server-side applications. Can be any
102
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
103
+ # @param [String] fields
104
+ # Selector specifying which fields to include in a partial response.
105
+ # @param [Google::Apis::RequestOptions] options
106
+ # Request-specific options
107
+ #
108
+ # @yield [result, err] Result & error if block supplied
109
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogsResponse] parsed result object
110
+ # @yieldparam err [StandardError] error object if request failed
111
+ #
112
+ # @return [Google::Apis::LoggingV2beta1::ListLogsResponse]
113
+ #
114
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
115
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
116
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
117
+ def list_organization_logs(parent, page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
118
+ command = make_simple_command(:get, 'v2beta1/{+parent}/logs', options)
119
+ command.response_representation = Google::Apis::LoggingV2beta1::ListLogsResponse::Representation
120
+ command.response_class = Google::Apis::LoggingV2beta1::ListLogsResponse
121
+ command.params['parent'] = parent unless parent.nil?
122
+ command.query['pageSize'] = page_size unless page_size.nil?
123
+ command.query['pageToken'] = page_token unless page_token.nil?
124
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
125
+ command.query['fields'] = fields unless fields.nil?
126
+ execute_or_queue_command(command, &block)
127
+ end
128
+
129
+ # Lists log entries. Use this method to retrieve log entries from Stackdriver
130
+ # Logging. For ways to export log entries, see Exporting Logs.
131
+ # @param [Google::Apis::LoggingV2beta1::ListLogEntriesRequest] list_log_entries_request_object
132
+ # @param [String] quota_user
133
+ # Available to use for quota purposes for server-side applications. Can be any
134
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
135
+ # @param [String] fields
136
+ # Selector specifying which fields to include in a partial response.
137
+ # @param [Google::Apis::RequestOptions] options
138
+ # Request-specific options
139
+ #
140
+ # @yield [result, err] Result & error if block supplied
141
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogEntriesResponse] parsed result object
142
+ # @yieldparam err [StandardError] error object if request failed
143
+ #
144
+ # @return [Google::Apis::LoggingV2beta1::ListLogEntriesResponse]
145
+ #
146
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
147
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
148
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
149
+ def list_entry_log_entries(list_log_entries_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
150
+ command = make_simple_command(:post, 'v2beta1/entries:list', options)
151
+ command.request_representation = Google::Apis::LoggingV2beta1::ListLogEntriesRequest::Representation
152
+ command.request_object = list_log_entries_request_object
153
+ command.response_representation = Google::Apis::LoggingV2beta1::ListLogEntriesResponse::Representation
154
+ command.response_class = Google::Apis::LoggingV2beta1::ListLogEntriesResponse
155
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
156
+ command.query['fields'] = fields unless fields.nil?
157
+ execute_or_queue_command(command, &block)
158
+ end
159
+
160
+ # Writes log entries to Stackdriver Logging. All log entries are written by this
161
+ # method.
162
+ # @param [Google::Apis::LoggingV2beta1::WriteLogEntriesRequest] write_log_entries_request_object
163
+ # @param [String] quota_user
164
+ # Available to use for quota purposes for server-side applications. Can be any
165
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
166
+ # @param [String] fields
167
+ # Selector specifying which fields to include in a partial response.
168
+ # @param [Google::Apis::RequestOptions] options
169
+ # Request-specific options
170
+ #
171
+ # @yield [result, err] Result & error if block supplied
172
+ # @yieldparam result [Google::Apis::LoggingV2beta1::WriteLogEntriesResponse] parsed result object
173
+ # @yieldparam err [StandardError] error object if request failed
174
+ #
175
+ # @return [Google::Apis::LoggingV2beta1::WriteLogEntriesResponse]
176
+ #
177
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
178
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
179
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
180
+ def write_entry_log_entries(write_log_entries_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
181
+ command = make_simple_command(:post, 'v2beta1/entries:write', options)
182
+ command.request_representation = Google::Apis::LoggingV2beta1::WriteLogEntriesRequest::Representation
183
+ command.request_object = write_log_entries_request_object
184
+ command.response_representation = Google::Apis::LoggingV2beta1::WriteLogEntriesResponse::Representation
185
+ command.response_class = Google::Apis::LoggingV2beta1::WriteLogEntriesResponse
186
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
187
+ command.query['fields'] = fields unless fields.nil?
188
+ execute_or_queue_command(command, &block)
189
+ end
190
+
191
+ # Creates or updates a logs-based metric.
87
192
  # @param [String] metric_name
88
- # The resource name of the desired metric.
89
- # Example: `"projects/my-project-id/metrics/my-metric-id"`.
193
+ # The resource name of the metric to update:
194
+ # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
195
+ # The updated metric must be provided in the request and it's name field must be
196
+ # the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a
197
+ # new metric is created.
198
+ # @param [Google::Apis::LoggingV2beta1::LogMetric] log_metric_object
90
199
  # @param [String] quota_user
91
200
  # Available to use for quota purposes for server-side applications. Can be any
92
201
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -104,8 +213,10 @@ module Google
104
213
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
105
214
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
106
215
  # @raise [Google::Apis::AuthorizationError] Authorization is required
107
- def get_project_metric(metric_name, quota_user: nil, fields: nil, options: nil, &block)
108
- command = make_simple_command(:get, 'v2beta1/{+metricName}', options)
216
+ def update_project_metric(metric_name, log_metric_object = nil, quota_user: nil, fields: nil, options: nil, &block)
217
+ command = make_simple_command(:put, 'v2beta1/{+metricName}', options)
218
+ command.request_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
219
+ command.request_object = log_metric_object
109
220
  command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
110
221
  command.response_class = Google::Apis::LoggingV2beta1::LogMetric
111
222
  command.params['metricName'] = metric_name unless metric_name.nil?
@@ -116,8 +227,8 @@ module Google
116
227
 
117
228
  # Creates a logs-based metric.
118
229
  # @param [String] parent
119
- # The resource name of the project in which to create the metric.
120
- # Example: `"projects/my-project-id"`.
230
+ # The resource name of the project in which to create the metric:
231
+ # "projects/[PROJECT_ID]"
121
232
  # The new metric must be provided in the request.
122
233
  # @param [Google::Apis::LoggingV2beta1::LogMetric] log_metric_object
123
234
  # @param [String] quota_user
@@ -149,19 +260,50 @@ module Google
149
260
  execute_or_queue_command(command, &block)
150
261
  end
151
262
 
263
+ # Deletes a logs-based metric.
264
+ # @param [String] metric_name
265
+ # The resource name of the metric to delete:
266
+ # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
267
+ # @param [String] quota_user
268
+ # Available to use for quota purposes for server-side applications. Can be any
269
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
270
+ # @param [String] fields
271
+ # Selector specifying which fields to include in a partial response.
272
+ # @param [Google::Apis::RequestOptions] options
273
+ # Request-specific options
274
+ #
275
+ # @yield [result, err] Result & error if block supplied
276
+ # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
277
+ # @yieldparam err [StandardError] error object if request failed
278
+ #
279
+ # @return [Google::Apis::LoggingV2beta1::Empty]
280
+ #
281
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
282
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
283
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
284
+ def delete_project_metric(metric_name, quota_user: nil, fields: nil, options: nil, &block)
285
+ command = make_simple_command(:delete, 'v2beta1/{+metricName}', options)
286
+ command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
287
+ command.response_class = Google::Apis::LoggingV2beta1::Empty
288
+ command.params['metricName'] = metric_name unless metric_name.nil?
289
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
290
+ command.query['fields'] = fields unless fields.nil?
291
+ execute_or_queue_command(command, &block)
292
+ end
293
+
152
294
  # Lists logs-based metrics.
153
295
  # @param [String] parent
154
- # Required. The resource name containing the metrics.
155
- # Example: `"projects/my-project-id"`.
156
- # @param [Fixnum] page_size
157
- # Optional. The maximum number of results to return from this request.
158
- # Non-positive values are ignored. The presence of `nextPageToken` in the
159
- # response indicates that more results might be available.
296
+ # Required. The name of the project containing the metrics:
297
+ # "projects/[PROJECT_ID]"
160
298
  # @param [String] page_token
161
299
  # Optional. If present, then retrieve the next batch of results from the
162
- # preceding call to this method. `pageToken` must be the value of
163
- # `nextPageToken` from the previous response. The values of other method
164
- # parameters should be identical to those in the previous call.
300
+ # preceding call to this method. pageToken must be the value of nextPageToken
301
+ # from the previous response. The values of other method parameters should be
302
+ # identical to those in the previous call.
303
+ # @param [Fixnum] page_size
304
+ # Optional. The maximum number of results to return from this request. Non-
305
+ # positive values are ignored. The presence of nextPageToken in the response
306
+ # indicates that more results might be available.
165
307
  # @param [String] quota_user
166
308
  # Available to use for quota purposes for server-side applications. Can be any
167
309
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -179,22 +321,22 @@ module Google
179
321
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
180
322
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
181
323
  # @raise [Google::Apis::AuthorizationError] Authorization is required
182
- def list_project_metrics(parent, page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
324
+ def list_project_metrics(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
183
325
  command = make_simple_command(:get, 'v2beta1/{+parent}/metrics', options)
184
326
  command.response_representation = Google::Apis::LoggingV2beta1::ListLogMetricsResponse::Representation
185
327
  command.response_class = Google::Apis::LoggingV2beta1::ListLogMetricsResponse
186
328
  command.params['parent'] = parent unless parent.nil?
187
- command.query['pageSize'] = page_size unless page_size.nil?
188
329
  command.query['pageToken'] = page_token unless page_token.nil?
330
+ command.query['pageSize'] = page_size unless page_size.nil?
189
331
  command.query['quotaUser'] = quota_user unless quota_user.nil?
190
332
  command.query['fields'] = fields unless fields.nil?
191
333
  execute_or_queue_command(command, &block)
192
334
  end
193
335
 
194
- # Deletes a logs-based metric.
336
+ # Gets a logs-based metric.
195
337
  # @param [String] metric_name
196
- # The resource name of the metric to delete.
197
- # Example: `"projects/my-project-id/metrics/my-metric-id"`.
338
+ # The resource name of the desired metric:
339
+ # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
198
340
  # @param [String] quota_user
199
341
  # Available to use for quota purposes for server-side applications. Can be any
200
342
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -204,29 +346,33 @@ module Google
204
346
  # Request-specific options
205
347
  #
206
348
  # @yield [result, err] Result & error if block supplied
207
- # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
349
+ # @yieldparam result [Google::Apis::LoggingV2beta1::LogMetric] parsed result object
208
350
  # @yieldparam err [StandardError] error object if request failed
209
351
  #
210
- # @return [Google::Apis::LoggingV2beta1::Empty]
352
+ # @return [Google::Apis::LoggingV2beta1::LogMetric]
211
353
  #
212
354
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
213
355
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
214
356
  # @raise [Google::Apis::AuthorizationError] Authorization is required
215
- def delete_project_metric(metric_name, quota_user: nil, fields: nil, options: nil, &block)
216
- command = make_simple_command(:delete, 'v2beta1/{+metricName}', options)
217
- command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
218
- command.response_class = Google::Apis::LoggingV2beta1::Empty
357
+ def get_project_metric(metric_name, quota_user: nil, fields: nil, options: nil, &block)
358
+ command = make_simple_command(:get, 'v2beta1/{+metricName}', options)
359
+ command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
360
+ command.response_class = Google::Apis::LoggingV2beta1::LogMetric
219
361
  command.params['metricName'] = metric_name unless metric_name.nil?
220
362
  command.query['quotaUser'] = quota_user unless quota_user.nil?
221
363
  command.query['fields'] = fields unless fields.nil?
222
364
  execute_or_queue_command(command, &block)
223
365
  end
224
366
 
225
- # Deletes a log and all its log entries.
226
- # The log will reappear if it receives new entries.
367
+ # Deletes all the log entries in a log. The log reappears if it receives new
368
+ # entries.
227
369
  # @param [String] log_name
228
- # Required. The resource name of the log to delete. Example:
229
- # `"projects/my-project/logs/syslog"`.
370
+ # Required. The resource name of the log to delete:
371
+ # "projects/[PROJECT_ID]/logs/[LOG_ID]"
372
+ # "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
373
+ # [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog"
374
+ # , "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%
375
+ # 2Factivity". For more information about log names, see LogEntry.
230
376
  # @param [String] quota_user
231
377
  # Available to use for quota purposes for server-side applications. Can be any
232
378
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -254,18 +400,21 @@ module Google
254
400
  execute_or_queue_command(command, &block)
255
401
  end
256
402
 
257
- # Updates or creates a sink.
258
- # @param [String] sink_name
259
- # Required. The resource name of the sink to update, including the parent
260
- # resource and the sink identifier. If the sink does not exist, this method
261
- # creates the sink. Example: `"projects/my-project-id/sinks/my-sink-id"`.
262
- # @param [Google::Apis::LoggingV2beta1::LogSink] log_sink_object
263
- # @param [Boolean] unique_writer_identity
264
- # Optional. Whether the sink will have a dedicated service account returned
265
- # in the sink's writer_identity. Set this field to be true to export
266
- # logs from one project to a different project. This field is ignored for
267
- # non-project sinks (e.g. organization sinks) because those sinks are
268
- # required to have dedicated service accounts.
403
+ # Lists the logs in projects or organizations. Only logs that have entries are
404
+ # listed.
405
+ # @param [String] parent
406
+ # Required. The resource name that owns the logs:
407
+ # "projects/[PROJECT_ID]"
408
+ # "organizations/[ORGANIZATION_ID]"
409
+ # @param [String] page_token
410
+ # Optional. If present, then retrieve the next batch of results from the
411
+ # preceding call to this method. pageToken must be the value of nextPageToken
412
+ # from the previous response. The values of other method parameters should be
413
+ # identical to those in the previous call.
414
+ # @param [Fixnum] page_size
415
+ # Optional. The maximum number of results to return from this request. Non-
416
+ # positive values are ignored. The presence of nextPageToken in the response
417
+ # indicates that more results might be available.
269
418
  # @param [String] quota_user
270
419
  # Available to use for quota purposes for server-side applications. Can be any
271
420
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -275,31 +424,35 @@ module Google
275
424
  # Request-specific options
276
425
  #
277
426
  # @yield [result, err] Result & error if block supplied
278
- # @yieldparam result [Google::Apis::LoggingV2beta1::LogSink] parsed result object
427
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogsResponse] parsed result object
279
428
  # @yieldparam err [StandardError] error object if request failed
280
429
  #
281
- # @return [Google::Apis::LoggingV2beta1::LogSink]
430
+ # @return [Google::Apis::LoggingV2beta1::ListLogsResponse]
282
431
  #
283
432
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
284
433
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
285
434
  # @raise [Google::Apis::AuthorizationError] Authorization is required
286
- def update_project_sink(sink_name, log_sink_object = nil, unique_writer_identity: nil, quota_user: nil, fields: nil, options: nil, &block)
287
- command = make_simple_command(:put, 'v2beta1/{+sinkName}', options)
288
- command.request_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
289
- command.request_object = log_sink_object
290
- command.response_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
291
- command.response_class = Google::Apis::LoggingV2beta1::LogSink
292
- command.params['sinkName'] = sink_name unless sink_name.nil?
293
- command.query['uniqueWriterIdentity'] = unique_writer_identity unless unique_writer_identity.nil?
435
+ def list_logs(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
436
+ command = make_simple_command(:get, 'v2beta1/{+parent}/logs', options)
437
+ command.response_representation = Google::Apis::LoggingV2beta1::ListLogsResponse::Representation
438
+ command.response_class = Google::Apis::LoggingV2beta1::ListLogsResponse
439
+ command.params['parent'] = parent unless parent.nil?
440
+ command.query['pageToken'] = page_token unless page_token.nil?
441
+ command.query['pageSize'] = page_size unless page_size.nil?
294
442
  command.query['quotaUser'] = quota_user unless quota_user.nil?
295
443
  command.query['fields'] = fields unless fields.nil?
296
444
  execute_or_queue_command(command, &block)
297
445
  end
298
446
 
299
- # Gets a sink.
447
+ # Deletes a sink. If the sink has a unique writer_identity, then that service
448
+ # account is also deleted.
300
449
  # @param [String] sink_name
301
- # Required. The resource name of the sink to return.
302
- # Example: `"projects/my-project-id/sinks/my-sink-id"`.
450
+ # Required. The full resource name of the sink to delete, including the parent
451
+ # resource and the sink identifier:
452
+ # "projects/[PROJECT_ID]/sinks/[SINK_ID]"
453
+ # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
454
+ # It is an error if the sink does not exist. Example: "projects/my-project-id/
455
+ # sinks/my-sink-id". It is an error if the sink does not exist.
303
456
  # @param [String] quota_user
304
457
  # Available to use for quota purposes for server-side applications. Can be any
305
458
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -309,79 +462,37 @@ module Google
309
462
  # Request-specific options
310
463
  #
311
464
  # @yield [result, err] Result & error if block supplied
312
- # @yieldparam result [Google::Apis::LoggingV2beta1::LogSink] parsed result object
465
+ # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
313
466
  # @yieldparam err [StandardError] error object if request failed
314
467
  #
315
- # @return [Google::Apis::LoggingV2beta1::LogSink]
468
+ # @return [Google::Apis::LoggingV2beta1::Empty]
316
469
  #
317
470
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
318
471
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
319
472
  # @raise [Google::Apis::AuthorizationError] Authorization is required
320
- def get_project_sink(sink_name, quota_user: nil, fields: nil, options: nil, &block)
321
- command = make_simple_command(:get, 'v2beta1/{+sinkName}', options)
322
- command.response_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
323
- command.response_class = Google::Apis::LoggingV2beta1::LogSink
473
+ def delete_project_sink(sink_name, quota_user: nil, fields: nil, options: nil, &block)
474
+ command = make_simple_command(:delete, 'v2beta1/{+sinkName}', options)
475
+ command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
476
+ command.response_class = Google::Apis::LoggingV2beta1::Empty
324
477
  command.params['sinkName'] = sink_name unless sink_name.nil?
325
478
  command.query['quotaUser'] = quota_user unless quota_user.nil?
326
479
  command.query['fields'] = fields unless fields.nil?
327
480
  execute_or_queue_command(command, &block)
328
481
  end
329
482
 
330
- # Creates a sink.
331
- # @param [String] parent
332
- # Required. The resource in which to create the sink.
333
- # Example: `"projects/my-project-id"`.
334
- # The new sink must be provided in the request.
335
- # @param [Google::Apis::LoggingV2beta1::LogSink] log_sink_object
336
- # @param [Boolean] unique_writer_identity
337
- # Optional. Whether the sink will have a dedicated service account returned
338
- # in the sink's writer_identity. Set this field to be true to export
339
- # logs from one project to a different project. This field is ignored for
340
- # non-project sinks (e.g. organization sinks) because those sinks are
341
- # required to have dedicated service accounts.
342
- # @param [String] quota_user
343
- # Available to use for quota purposes for server-side applications. Can be any
344
- # arbitrary string assigned to a user, but should not exceed 40 characters.
345
- # @param [String] fields
346
- # Selector specifying which fields to include in a partial response.
347
- # @param [Google::Apis::RequestOptions] options
348
- # Request-specific options
349
- #
350
- # @yield [result, err] Result & error if block supplied
351
- # @yieldparam result [Google::Apis::LoggingV2beta1::LogSink] parsed result object
352
- # @yieldparam err [StandardError] error object if request failed
353
- #
354
- # @return [Google::Apis::LoggingV2beta1::LogSink]
355
- #
356
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
357
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
358
- # @raise [Google::Apis::AuthorizationError] Authorization is required
359
- def create_project_sink(parent, log_sink_object = nil, unique_writer_identity: nil, quota_user: nil, fields: nil, options: nil, &block)
360
- command = make_simple_command(:post, 'v2beta1/{+parent}/sinks', options)
361
- command.request_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
362
- command.request_object = log_sink_object
363
- command.response_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
364
- command.response_class = Google::Apis::LoggingV2beta1::LogSink
365
- command.params['parent'] = parent unless parent.nil?
366
- command.query['uniqueWriterIdentity'] = unique_writer_identity unless unique_writer_identity.nil?
367
- command.query['quotaUser'] = quota_user unless quota_user.nil?
368
- command.query['fields'] = fields unless fields.nil?
369
- execute_or_queue_command(command, &block)
370
- end
371
-
372
483
  # Lists sinks.
373
484
  # @param [String] parent
374
- # Required. The resource name where this sink was created.
375
- # Example: `"projects/my-logging-project"`.
376
- # @param [Fixnum] page_size
377
- # Optional. The maximum number of results to return from this request.
378
- # Non-positive values are ignored. The presence of `nextPageToken` in the
379
- # response indicates that more results might be available.
485
+ # Required. The parent resource whose sinks are to be listed. Examples: "
486
+ # projects/my-logging-project", "organizations/123456789".
380
487
  # @param [String] page_token
381
488
  # Optional. If present, then retrieve the next batch of results from the
382
- # preceding call to this method. `pageToken` must be the value of
383
- # `nextPageToken` from the previous response. The values of other method
384
- # parameters should be identical to those in the previous call.
489
+ # preceding call to this method. pageToken must be the value of nextPageToken
490
+ # from the previous response. The values of other method parameters should be
491
+ # identical to those in the previous call.
492
+ # @param [Fixnum] page_size
493
+ # Optional. The maximum number of results to return from this request. Non-
494
+ # positive values are ignored. The presence of nextPageToken in the response
495
+ # indicates that more results might be available.
385
496
  # @param [String] quota_user
386
497
  # Available to use for quota purposes for server-side applications. Can be any
387
498
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -399,24 +510,24 @@ module Google
399
510
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
400
511
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
401
512
  # @raise [Google::Apis::AuthorizationError] Authorization is required
402
- def list_project_sinks(parent, page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
513
+ def list_project_sinks(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
403
514
  command = make_simple_command(:get, 'v2beta1/{+parent}/sinks', options)
404
515
  command.response_representation = Google::Apis::LoggingV2beta1::ListSinksResponse::Representation
405
516
  command.response_class = Google::Apis::LoggingV2beta1::ListSinksResponse
406
517
  command.params['parent'] = parent unless parent.nil?
407
- command.query['pageSize'] = page_size unless page_size.nil?
408
518
  command.query['pageToken'] = page_token unless page_token.nil?
519
+ command.query['pageSize'] = page_size unless page_size.nil?
409
520
  command.query['quotaUser'] = quota_user unless quota_user.nil?
410
521
  command.query['fields'] = fields unless fields.nil?
411
522
  execute_or_queue_command(command, &block)
412
523
  end
413
524
 
414
- # Deletes a sink.
525
+ # Gets a sink.
415
526
  # @param [String] sink_name
416
- # Required. The resource name of the sink to delete, including the parent
417
- # resource and the sink identifier. Example:
418
- # `"projects/my-project-id/sinks/my-sink-id"`. It is an error if the sink
419
- # does not exist.
527
+ # Required. The parent resource name of the sink:
528
+ # "projects/[PROJECT_ID]/sinks/[SINK_ID]"
529
+ # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
530
+ # Example: "projects/my-project-id/sinks/my-sink-id".
420
531
  # @param [String] quota_user
421
532
  # Available to use for quota purposes for server-side applications. Can be any
422
533
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -426,29 +537,46 @@ module Google
426
537
  # Request-specific options
427
538
  #
428
539
  # @yield [result, err] Result & error if block supplied
429
- # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
540
+ # @yieldparam result [Google::Apis::LoggingV2beta1::LogSink] parsed result object
430
541
  # @yieldparam err [StandardError] error object if request failed
431
542
  #
432
- # @return [Google::Apis::LoggingV2beta1::Empty]
543
+ # @return [Google::Apis::LoggingV2beta1::LogSink]
433
544
  #
434
545
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
435
546
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
436
547
  # @raise [Google::Apis::AuthorizationError] Authorization is required
437
- def delete_project_sink(sink_name, quota_user: nil, fields: nil, options: nil, &block)
438
- command = make_simple_command(:delete, 'v2beta1/{+sinkName}', options)
439
- command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
440
- command.response_class = Google::Apis::LoggingV2beta1::Empty
548
+ def get_project_sink(sink_name, quota_user: nil, fields: nil, options: nil, &block)
549
+ command = make_simple_command(:get, 'v2beta1/{+sinkName}', options)
550
+ command.response_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
551
+ command.response_class = Google::Apis::LoggingV2beta1::LogSink
441
552
  command.params['sinkName'] = sink_name unless sink_name.nil?
442
553
  command.query['quotaUser'] = quota_user unless quota_user.nil?
443
554
  command.query['fields'] = fields unless fields.nil?
444
555
  execute_or_queue_command(command, &block)
445
556
  end
446
557
 
447
- # Deletes a log and all its log entries.
448
- # The log will reappear if it receives new entries.
449
- # @param [String] log_name
450
- # Required. The resource name of the log to delete. Example:
451
- # `"projects/my-project/logs/syslog"`.
558
+ # Updates a sink. If the named sink doesn't exist, then this method is identical
559
+ # to sinks.create. If the named sink does exist, then this method replaces the
560
+ # following fields in the existing sink with values from the new sink:
561
+ # destination, filter, output_version_format, start_time, and end_time. The
562
+ # updated filter might also have a new writer_identity; see the
563
+ # unique_writer_identity field.
564
+ # @param [String] sink_name
565
+ # Required. The full resource name of the sink to update, including the parent
566
+ # resource and the sink identifier:
567
+ # "projects/[PROJECT_ID]/sinks/[SINK_ID]"
568
+ # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
569
+ # Example: "projects/my-project-id/sinks/my-sink-id".
570
+ # @param [Google::Apis::LoggingV2beta1::LogSink] log_sink_object
571
+ # @param [Boolean] unique_writer_identity
572
+ # Optional. See sinks.create for a description of this field. When updating a
573
+ # sink, the effect of this field on the value of writer_identity in the updated
574
+ # sink depends on both the old and new values of this field:
575
+ # If the old and new values of this field are both false or both true, then
576
+ # there is no change to the sink's writer_identity.
577
+ # If the old value was false and the new value is true, then writer_identity is
578
+ # changed to a unique service account.
579
+ # It is an error if the old value was true and the new value is false.
452
580
  # @param [String] quota_user
453
581
  # Available to use for quota purposes for server-side applications. Can be any
454
582
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -458,27 +586,48 @@ module Google
458
586
  # Request-specific options
459
587
  #
460
588
  # @yield [result, err] Result & error if block supplied
461
- # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
589
+ # @yieldparam result [Google::Apis::LoggingV2beta1::LogSink] parsed result object
462
590
  # @yieldparam err [StandardError] error object if request failed
463
591
  #
464
- # @return [Google::Apis::LoggingV2beta1::Empty]
592
+ # @return [Google::Apis::LoggingV2beta1::LogSink]
465
593
  #
466
594
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
467
595
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
468
596
  # @raise [Google::Apis::AuthorizationError] Authorization is required
469
- def delete_organization_log(log_name, quota_user: nil, fields: nil, options: nil, &block)
470
- command = make_simple_command(:delete, 'v2beta1/{+logName}', options)
471
- command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
472
- command.response_class = Google::Apis::LoggingV2beta1::Empty
473
- command.params['logName'] = log_name unless log_name.nil?
597
+ def update_project_sink(sink_name, log_sink_object = nil, unique_writer_identity: nil, quota_user: nil, fields: nil, options: nil, &block)
598
+ command = make_simple_command(:put, 'v2beta1/{+sinkName}', options)
599
+ command.request_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
600
+ command.request_object = log_sink_object
601
+ command.response_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
602
+ command.response_class = Google::Apis::LoggingV2beta1::LogSink
603
+ command.params['sinkName'] = sink_name unless sink_name.nil?
604
+ command.query['uniqueWriterIdentity'] = unique_writer_identity unless unique_writer_identity.nil?
474
605
  command.query['quotaUser'] = quota_user unless quota_user.nil?
475
606
  command.query['fields'] = fields unless fields.nil?
476
607
  execute_or_queue_command(command, &block)
477
608
  end
478
609
 
479
- # Writes log entries to Stackdriver Logging. All log entries are
480
- # written by this method.
481
- # @param [Google::Apis::LoggingV2beta1::WriteLogEntriesRequest] write_log_entries_request_object
610
+ # Creates a sink that exports specified log entries to a destination. The export
611
+ # of newly-ingested log entries begins immediately, unless the current time is
612
+ # outside the sink's start and end times or the sink's writer_identity is not
613
+ # permitted to write to the destination. A sink can export log entries only from
614
+ # the resource owning the sink.
615
+ # @param [String] parent
616
+ # Required. The resource in which to create the sink:
617
+ # "projects/[PROJECT_ID]"
618
+ # "organizations/[ORGANIZATION_ID]"
619
+ # Examples: "projects/my-logging-project", "organizations/123456789".
620
+ # @param [Google::Apis::LoggingV2beta1::LogSink] log_sink_object
621
+ # @param [Boolean] unique_writer_identity
622
+ # Optional. Determines the kind of IAM identity returned as writer_identity in
623
+ # the new sink. If this value is omitted or set to false, and if the sink's
624
+ # parent is a project, then the value returned as writer_identity is cloud-logs@
625
+ # google.com, the same identity used before the addition of writer identities to
626
+ # this API. The sink's destination must be in the same project as the sink
627
+ # itself.If this field is set to true, or if the sink is owned by a non-project
628
+ # resource such as an organization, then the value of writer_identity will be a
629
+ # unique service account used only for exports from the new sink. For more
630
+ # information, see writer_identity in LogSink.
482
631
  # @param [String] quota_user
483
632
  # Available to use for quota purposes for server-side applications. Can be any
484
633
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -488,29 +637,36 @@ module Google
488
637
  # Request-specific options
489
638
  #
490
639
  # @yield [result, err] Result & error if block supplied
491
- # @yieldparam result [Google::Apis::LoggingV2beta1::WriteLogEntriesResponse] parsed result object
640
+ # @yieldparam result [Google::Apis::LoggingV2beta1::LogSink] parsed result object
492
641
  # @yieldparam err [StandardError] error object if request failed
493
642
  #
494
- # @return [Google::Apis::LoggingV2beta1::WriteLogEntriesResponse]
643
+ # @return [Google::Apis::LoggingV2beta1::LogSink]
495
644
  #
496
645
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
497
646
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
498
647
  # @raise [Google::Apis::AuthorizationError] Authorization is required
499
- def write_entry_log_entries(write_log_entries_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
500
- command = make_simple_command(:post, 'v2beta1/entries:write', options)
501
- command.request_representation = Google::Apis::LoggingV2beta1::WriteLogEntriesRequest::Representation
502
- command.request_object = write_log_entries_request_object
503
- command.response_representation = Google::Apis::LoggingV2beta1::WriteLogEntriesResponse::Representation
504
- command.response_class = Google::Apis::LoggingV2beta1::WriteLogEntriesResponse
648
+ def create_project_sink(parent, log_sink_object = nil, unique_writer_identity: nil, quota_user: nil, fields: nil, options: nil, &block)
649
+ command = make_simple_command(:post, 'v2beta1/{+parent}/sinks', options)
650
+ command.request_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
651
+ command.request_object = log_sink_object
652
+ command.response_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
653
+ command.response_class = Google::Apis::LoggingV2beta1::LogSink
654
+ command.params['parent'] = parent unless parent.nil?
655
+ command.query['uniqueWriterIdentity'] = unique_writer_identity unless unique_writer_identity.nil?
505
656
  command.query['quotaUser'] = quota_user unless quota_user.nil?
506
657
  command.query['fields'] = fields unless fields.nil?
507
658
  execute_or_queue_command(command, &block)
508
659
  end
509
660
 
510
- # Lists log entries. Use this method to retrieve log entries from Cloud
511
- # Logging. For ways to export log entries, see
512
- # [Exporting Logs](/logging/docs/export).
513
- # @param [Google::Apis::LoggingV2beta1::ListLogEntriesRequest] list_log_entries_request_object
661
+ # Deletes all the log entries in a log. The log reappears if it receives new
662
+ # entries.
663
+ # @param [String] log_name
664
+ # Required. The resource name of the log to delete:
665
+ # "projects/[PROJECT_ID]/logs/[LOG_ID]"
666
+ # "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
667
+ # [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog"
668
+ # , "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%
669
+ # 2Factivity". For more information about log names, see LogEntry.
514
670
  # @param [String] quota_user
515
671
  # Available to use for quota purposes for server-side applications. Can be any
516
672
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -520,35 +676,39 @@ module Google
520
676
  # Request-specific options
521
677
  #
522
678
  # @yield [result, err] Result & error if block supplied
523
- # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogEntriesResponse] parsed result object
679
+ # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
524
680
  # @yieldparam err [StandardError] error object if request failed
525
681
  #
526
- # @return [Google::Apis::LoggingV2beta1::ListLogEntriesResponse]
682
+ # @return [Google::Apis::LoggingV2beta1::Empty]
527
683
  #
528
684
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
529
685
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
530
686
  # @raise [Google::Apis::AuthorizationError] Authorization is required
531
- def list_entry_log_entries(list_log_entries_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
532
- command = make_simple_command(:post, 'v2beta1/entries:list', options)
533
- command.request_representation = Google::Apis::LoggingV2beta1::ListLogEntriesRequest::Representation
534
- command.request_object = list_log_entries_request_object
535
- command.response_representation = Google::Apis::LoggingV2beta1::ListLogEntriesResponse::Representation
536
- command.response_class = Google::Apis::LoggingV2beta1::ListLogEntriesResponse
687
+ def delete_billing_account_log(log_name, quota_user: nil, fields: nil, options: nil, &block)
688
+ command = make_simple_command(:delete, 'v2beta1/{+logName}', options)
689
+ command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
690
+ command.response_class = Google::Apis::LoggingV2beta1::Empty
691
+ command.params['logName'] = log_name unless log_name.nil?
537
692
  command.query['quotaUser'] = quota_user unless quota_user.nil?
538
693
  command.query['fields'] = fields unless fields.nil?
539
694
  execute_or_queue_command(command, &block)
540
695
  end
541
696
 
542
- # Lists the monitored resource descriptors used by Stackdriver Logging.
543
- # @param [Fixnum] page_size
544
- # Optional. The maximum number of results to return from this request.
545
- # Non-positive values are ignored. The presence of `nextPageToken` in the
546
- # response indicates that more results might be available.
697
+ # Lists the logs in projects or organizations. Only logs that have entries are
698
+ # listed.
699
+ # @param [String] parent
700
+ # Required. The resource name that owns the logs:
701
+ # "projects/[PROJECT_ID]"
702
+ # "organizations/[ORGANIZATION_ID]"
547
703
  # @param [String] page_token
548
704
  # Optional. If present, then retrieve the next batch of results from the
549
- # preceding call to this method. `pageToken` must be the value of
550
- # `nextPageToken` from the previous response. The values of other method
551
- # parameters should be identical to those in the previous call.
705
+ # preceding call to this method. pageToken must be the value of nextPageToken
706
+ # from the previous response. The values of other method parameters should be
707
+ # identical to those in the previous call.
708
+ # @param [Fixnum] page_size
709
+ # Optional. The maximum number of results to return from this request. Non-
710
+ # positive values are ignored. The presence of nextPageToken in the response
711
+ # indicates that more results might be available.
552
712
  # @param [String] quota_user
553
713
  # Available to use for quota purposes for server-side applications. Can be any
554
714
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -558,30 +718,36 @@ module Google
558
718
  # Request-specific options
559
719
  #
560
720
  # @yield [result, err] Result & error if block supplied
561
- # @yieldparam result [Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse] parsed result object
721
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogsResponse] parsed result object
562
722
  # @yieldparam err [StandardError] error object if request failed
563
723
  #
564
- # @return [Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse]
724
+ # @return [Google::Apis::LoggingV2beta1::ListLogsResponse]
565
725
  #
566
726
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
567
727
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
568
728
  # @raise [Google::Apis::AuthorizationError] Authorization is required
569
- def list_monitored_resource_descriptors(page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
570
- command = make_simple_command(:get, 'v2beta1/monitoredResourceDescriptors', options)
571
- command.response_representation = Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse::Representation
572
- command.response_class = Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse
573
- command.query['pageSize'] = page_size unless page_size.nil?
729
+ def list_billing_account_logs(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
730
+ command = make_simple_command(:get, 'v2beta1/{+parent}/logs', options)
731
+ command.response_representation = Google::Apis::LoggingV2beta1::ListLogsResponse::Representation
732
+ command.response_class = Google::Apis::LoggingV2beta1::ListLogsResponse
733
+ command.params['parent'] = parent unless parent.nil?
574
734
  command.query['pageToken'] = page_token unless page_token.nil?
735
+ command.query['pageSize'] = page_size unless page_size.nil?
575
736
  command.query['quotaUser'] = quota_user unless quota_user.nil?
576
737
  command.query['fields'] = fields unless fields.nil?
577
738
  execute_or_queue_command(command, &block)
578
739
  end
579
740
 
580
- # Deletes a log and all its log entries.
581
- # The log will reappear if it receives new entries.
582
- # @param [String] log_name
583
- # Required. The resource name of the log to delete. Example:
584
- # `"projects/my-project/logs/syslog"`.
741
+ # Lists the descriptors for monitored resource types used by Stackdriver Logging.
742
+ # @param [String] page_token
743
+ # Optional. If present, then retrieve the next batch of results from the
744
+ # preceding call to this method. pageToken must be the value of nextPageToken
745
+ # from the previous response. The values of other method parameters should be
746
+ # identical to those in the previous call.
747
+ # @param [Fixnum] page_size
748
+ # Optional. The maximum number of results to return from this request. Non-
749
+ # positive values are ignored. The presence of nextPageToken in the response
750
+ # indicates that more results might be available.
585
751
  # @param [String] quota_user
586
752
  # Available to use for quota purposes for server-side applications. Can be any
587
753
  # arbitrary string assigned to a user, but should not exceed 40 characters.
@@ -591,19 +757,20 @@ module Google
591
757
  # Request-specific options
592
758
  #
593
759
  # @yield [result, err] Result & error if block supplied
594
- # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
760
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse] parsed result object
595
761
  # @yieldparam err [StandardError] error object if request failed
596
762
  #
597
- # @return [Google::Apis::LoggingV2beta1::Empty]
763
+ # @return [Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse]
598
764
  #
599
765
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
600
766
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
601
767
  # @raise [Google::Apis::AuthorizationError] Authorization is required
602
- def delete_billing_account_log(log_name, quota_user: nil, fields: nil, options: nil, &block)
603
- command = make_simple_command(:delete, 'v2beta1/{+logName}', options)
604
- command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
605
- command.response_class = Google::Apis::LoggingV2beta1::Empty
606
- command.params['logName'] = log_name unless log_name.nil?
768
+ def list_monitored_resource_descriptors(page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
769
+ command = make_simple_command(:get, 'v2beta1/monitoredResourceDescriptors', options)
770
+ command.response_representation = Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse::Representation
771
+ command.response_class = Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse
772
+ command.query['pageToken'] = page_token unless page_token.nil?
773
+ command.query['pageSize'] = page_size unless page_size.nil?
607
774
  command.query['quotaUser'] = quota_user unless quota_user.nil?
608
775
  command.query['fields'] = fields unless fields.nil?
609
776
  execute_or_queue_command(command, &block)
@@ -612,8 +779,8 @@ module Google
612
779
  protected
613
780
 
614
781
  def apply_command_defaults(command)
615
- command.query['key'] = key unless key.nil?
616
782
  command.query['quotaUser'] = quota_user unless quota_user.nil?
783
+ command.query['key'] = key unless key.nil?
617
784
  end
618
785
  end
619
786
  end