Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

94 linhas
2.0 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 trace_test
  16. import (
  17. "context"
  18. trace "cloud.google.com/go/trace/apiv1"
  19. "google.golang.org/api/iterator"
  20. cloudtracepb "google.golang.org/genproto/googleapis/devtools/cloudtrace/v1"
  21. )
  22. func ExampleNewClient() {
  23. ctx := context.Background()
  24. c, err := trace.NewClient(ctx)
  25. if err != nil {
  26. // TODO: Handle error.
  27. }
  28. // TODO: Use client.
  29. _ = c
  30. }
  31. func ExampleClient_PatchTraces() {
  32. ctx := context.Background()
  33. c, err := trace.NewClient(ctx)
  34. if err != nil {
  35. // TODO: Handle error.
  36. }
  37. req := &cloudtracepb.PatchTracesRequest{
  38. // TODO: Fill request struct fields.
  39. }
  40. err = c.PatchTraces(ctx, req)
  41. if err != nil {
  42. // TODO: Handle error.
  43. }
  44. }
  45. func ExampleClient_GetTrace() {
  46. ctx := context.Background()
  47. c, err := trace.NewClient(ctx)
  48. if err != nil {
  49. // TODO: Handle error.
  50. }
  51. req := &cloudtracepb.GetTraceRequest{
  52. // TODO: Fill request struct fields.
  53. }
  54. resp, err := c.GetTrace(ctx, req)
  55. if err != nil {
  56. // TODO: Handle error.
  57. }
  58. // TODO: Use resp.
  59. _ = resp
  60. }
  61. func ExampleClient_ListTraces() {
  62. ctx := context.Background()
  63. c, err := trace.NewClient(ctx)
  64. if err != nil {
  65. // TODO: Handle error.
  66. }
  67. req := &cloudtracepb.ListTracesRequest{
  68. // TODO: Fill request struct fields.
  69. }
  70. it := c.ListTraces(ctx, req)
  71. for {
  72. resp, err := it.Next()
  73. if err == iterator.Done {
  74. break
  75. }
  76. if err != nil {
  77. // TODO: Handle error.
  78. }
  79. // TODO: Use resp.
  80. _ = resp
  81. }
  82. }