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.
 
 
 

194 lines
3.8 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 talent_test
  16. import (
  17. "context"
  18. talent "cloud.google.com/go/talent/apiv4beta1"
  19. "google.golang.org/api/iterator"
  20. talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
  21. )
  22. func ExampleNewJobClient() {
  23. ctx := context.Background()
  24. c, err := talent.NewJobClient(ctx)
  25. if err != nil {
  26. // TODO: Handle error.
  27. }
  28. // TODO: Use client.
  29. _ = c
  30. }
  31. func ExampleJobClient_CreateJob() {
  32. ctx := context.Background()
  33. c, err := talent.NewJobClient(ctx)
  34. if err != nil {
  35. // TODO: Handle error.
  36. }
  37. req := &talentpb.CreateJobRequest{
  38. // TODO: Fill request struct fields.
  39. }
  40. resp, err := c.CreateJob(ctx, req)
  41. if err != nil {
  42. // TODO: Handle error.
  43. }
  44. // TODO: Use resp.
  45. _ = resp
  46. }
  47. func ExampleJobClient_GetJob() {
  48. ctx := context.Background()
  49. c, err := talent.NewJobClient(ctx)
  50. if err != nil {
  51. // TODO: Handle error.
  52. }
  53. req := &talentpb.GetJobRequest{
  54. // TODO: Fill request struct fields.
  55. }
  56. resp, err := c.GetJob(ctx, req)
  57. if err != nil {
  58. // TODO: Handle error.
  59. }
  60. // TODO: Use resp.
  61. _ = resp
  62. }
  63. func ExampleJobClient_UpdateJob() {
  64. ctx := context.Background()
  65. c, err := talent.NewJobClient(ctx)
  66. if err != nil {
  67. // TODO: Handle error.
  68. }
  69. req := &talentpb.UpdateJobRequest{
  70. // TODO: Fill request struct fields.
  71. }
  72. resp, err := c.UpdateJob(ctx, req)
  73. if err != nil {
  74. // TODO: Handle error.
  75. }
  76. // TODO: Use resp.
  77. _ = resp
  78. }
  79. func ExampleJobClient_DeleteJob() {
  80. ctx := context.Background()
  81. c, err := talent.NewJobClient(ctx)
  82. if err != nil {
  83. // TODO: Handle error.
  84. }
  85. req := &talentpb.DeleteJobRequest{
  86. // TODO: Fill request struct fields.
  87. }
  88. err = c.DeleteJob(ctx, req)
  89. if err != nil {
  90. // TODO: Handle error.
  91. }
  92. }
  93. func ExampleJobClient_ListJobs() {
  94. ctx := context.Background()
  95. c, err := talent.NewJobClient(ctx)
  96. if err != nil {
  97. // TODO: Handle error.
  98. }
  99. req := &talentpb.ListJobsRequest{
  100. // TODO: Fill request struct fields.
  101. }
  102. it := c.ListJobs(ctx, req)
  103. for {
  104. resp, err := it.Next()
  105. if err == iterator.Done {
  106. break
  107. }
  108. if err != nil {
  109. // TODO: Handle error.
  110. }
  111. // TODO: Use resp.
  112. _ = resp
  113. }
  114. }
  115. func ExampleJobClient_BatchDeleteJobs() {
  116. ctx := context.Background()
  117. c, err := talent.NewJobClient(ctx)
  118. if err != nil {
  119. // TODO: Handle error.
  120. }
  121. req := &talentpb.BatchDeleteJobsRequest{
  122. // TODO: Fill request struct fields.
  123. }
  124. err = c.BatchDeleteJobs(ctx, req)
  125. if err != nil {
  126. // TODO: Handle error.
  127. }
  128. }
  129. func ExampleJobClient_SearchJobs() {
  130. ctx := context.Background()
  131. c, err := talent.NewJobClient(ctx)
  132. if err != nil {
  133. // TODO: Handle error.
  134. }
  135. req := &talentpb.SearchJobsRequest{
  136. // TODO: Fill request struct fields.
  137. }
  138. it := c.SearchJobs(ctx, req)
  139. for {
  140. resp, err := it.Next()
  141. if err == iterator.Done {
  142. break
  143. }
  144. if err != nil {
  145. // TODO: Handle error.
  146. }
  147. // TODO: Use resp.
  148. _ = resp
  149. }
  150. }
  151. func ExampleJobClient_SearchJobsForAlert() {
  152. ctx := context.Background()
  153. c, err := talent.NewJobClient(ctx)
  154. if err != nil {
  155. // TODO: Handle error.
  156. }
  157. req := &talentpb.SearchJobsRequest{
  158. // TODO: Fill request struct fields.
  159. }
  160. it := c.SearchJobsForAlert(ctx, req)
  161. for {
  162. resp, err := it.Next()
  163. if err == iterator.Done {
  164. break
  165. }
  166. if err != nil {
  167. // TODO: Handle error.
  168. }
  169. // TODO: Use resp.
  170. _ = resp
  171. }
  172. }