You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

151 lines
3.6 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 containeranalysis_test
  16. import (
  17. "context"
  18. containeranalysis "cloud.google.com/go/containeranalysis/apiv1beta1"
  19. "google.golang.org/api/iterator"
  20. containeranalysispb "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1"
  21. iampb "google.golang.org/genproto/googleapis/iam/v1"
  22. )
  23. func ExampleNewContainerAnalysisV1Beta1Client() {
  24. ctx := context.Background()
  25. c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
  26. if err != nil {
  27. // TODO: Handle error.
  28. }
  29. // TODO: Use client.
  30. _ = c
  31. }
  32. func ExampleContainerAnalysisV1Beta1Client_SetIamPolicy() {
  33. ctx := context.Background()
  34. c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
  35. if err != nil {
  36. // TODO: Handle error.
  37. }
  38. req := &iampb.SetIamPolicyRequest{
  39. // TODO: Fill request struct fields.
  40. }
  41. resp, err := c.SetIamPolicy(ctx, req)
  42. if err != nil {
  43. // TODO: Handle error.
  44. }
  45. // TODO: Use resp.
  46. _ = resp
  47. }
  48. func ExampleContainerAnalysisV1Beta1Client_GetIamPolicy() {
  49. ctx := context.Background()
  50. c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
  51. if err != nil {
  52. // TODO: Handle error.
  53. }
  54. req := &iampb.GetIamPolicyRequest{
  55. // TODO: Fill request struct fields.
  56. }
  57. resp, err := c.GetIamPolicy(ctx, req)
  58. if err != nil {
  59. // TODO: Handle error.
  60. }
  61. // TODO: Use resp.
  62. _ = resp
  63. }
  64. func ExampleContainerAnalysisV1Beta1Client_TestIamPermissions() {
  65. ctx := context.Background()
  66. c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
  67. if err != nil {
  68. // TODO: Handle error.
  69. }
  70. req := &iampb.TestIamPermissionsRequest{
  71. // TODO: Fill request struct fields.
  72. }
  73. resp, err := c.TestIamPermissions(ctx, req)
  74. if err != nil {
  75. // TODO: Handle error.
  76. }
  77. // TODO: Use resp.
  78. _ = resp
  79. }
  80. func ExampleContainerAnalysisV1Beta1Client_GetScanConfig() {
  81. ctx := context.Background()
  82. c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
  83. if err != nil {
  84. // TODO: Handle error.
  85. }
  86. req := &containeranalysispb.GetScanConfigRequest{
  87. // TODO: Fill request struct fields.
  88. }
  89. resp, err := c.GetScanConfig(ctx, req)
  90. if err != nil {
  91. // TODO: Handle error.
  92. }
  93. // TODO: Use resp.
  94. _ = resp
  95. }
  96. func ExampleContainerAnalysisV1Beta1Client_ListScanConfigs() {
  97. ctx := context.Background()
  98. c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
  99. if err != nil {
  100. // TODO: Handle error.
  101. }
  102. req := &containeranalysispb.ListScanConfigsRequest{
  103. // TODO: Fill request struct fields.
  104. }
  105. it := c.ListScanConfigs(ctx, req)
  106. for {
  107. resp, err := it.Next()
  108. if err == iterator.Done {
  109. break
  110. }
  111. if err != nil {
  112. // TODO: Handle error.
  113. }
  114. // TODO: Use resp.
  115. _ = resp
  116. }
  117. }
  118. func ExampleContainerAnalysisV1Beta1Client_UpdateScanConfig() {
  119. ctx := context.Background()
  120. c, err := containeranalysis.NewContainerAnalysisV1Beta1Client(ctx)
  121. if err != nil {
  122. // TODO: Handle error.
  123. }
  124. req := &containeranalysispb.UpdateScanConfigRequest{
  125. // TODO: Fill request struct fields.
  126. }
  127. resp, err := c.UpdateScanConfig(ctx, req)
  128. if err != nil {
  129. // TODO: Handle error.
  130. }
  131. // TODO: Use resp.
  132. _ = resp
  133. }