選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

102 行
2.3 KiB

  1. // Copyright 2019 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // https://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Code generated by gapic-generator. DO NOT EDIT.
  15. package errorreporting_test
  16. import (
  17. "context"
  18. errorreporting "cloud.google.com/go/errorreporting/apiv1beta1"
  19. "google.golang.org/api/iterator"
  20. clouderrorreportingpb "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1"
  21. )
  22. func ExampleNewErrorStatsClient() {
  23. ctx := context.Background()
  24. c, err := errorreporting.NewErrorStatsClient(ctx)
  25. if err != nil {
  26. // TODO: Handle error.
  27. }
  28. // TODO: Use client.
  29. _ = c
  30. }
  31. func ExampleErrorStatsClient_ListGroupStats() {
  32. ctx := context.Background()
  33. c, err := errorreporting.NewErrorStatsClient(ctx)
  34. if err != nil {
  35. // TODO: Handle error.
  36. }
  37. req := &clouderrorreportingpb.ListGroupStatsRequest{
  38. // TODO: Fill request struct fields.
  39. }
  40. it := c.ListGroupStats(ctx, req)
  41. for {
  42. resp, err := it.Next()
  43. if err == iterator.Done {
  44. break
  45. }
  46. if err != nil {
  47. // TODO: Handle error.
  48. }
  49. // TODO: Use resp.
  50. _ = resp
  51. }
  52. }
  53. func ExampleErrorStatsClient_ListEvents() {
  54. ctx := context.Background()
  55. c, err := errorreporting.NewErrorStatsClient(ctx)
  56. if err != nil {
  57. // TODO: Handle error.
  58. }
  59. req := &clouderrorreportingpb.ListEventsRequest{
  60. // TODO: Fill request struct fields.
  61. }
  62. it := c.ListEvents(ctx, req)
  63. for {
  64. resp, err := it.Next()
  65. if err == iterator.Done {
  66. break
  67. }
  68. if err != nil {
  69. // TODO: Handle error.
  70. }
  71. // TODO: Use resp.
  72. _ = resp
  73. }
  74. }
  75. func ExampleErrorStatsClient_DeleteEvents() {
  76. ctx := context.Background()
  77. c, err := errorreporting.NewErrorStatsClient(ctx)
  78. if err != nil {
  79. // TODO: Handle error.
  80. }
  81. req := &clouderrorreportingpb.DeleteEventsRequest{
  82. // TODO: Fill request struct fields.
  83. }
  84. resp, err := c.DeleteEvents(ctx, req)
  85. if err != nil {
  86. // TODO: Handle error.
  87. }
  88. // TODO: Use resp.
  89. _ = resp
  90. }