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.
 
 
 

634 lines
12 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 irm_test
  16. import (
  17. "context"
  18. irm "cloud.google.com/go/irm/apiv1alpha2"
  19. "google.golang.org/api/iterator"
  20. irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
  21. )
  22. func ExampleNewIncidentClient() {
  23. ctx := context.Background()
  24. c, err := irm.NewIncidentClient(ctx)
  25. if err != nil {
  26. // TODO: Handle error.
  27. }
  28. // TODO: Use client.
  29. _ = c
  30. }
  31. func ExampleIncidentClient_CreateIncident() {
  32. ctx := context.Background()
  33. c, err := irm.NewIncidentClient(ctx)
  34. if err != nil {
  35. // TODO: Handle error.
  36. }
  37. req := &irmpb.CreateIncidentRequest{
  38. // TODO: Fill request struct fields.
  39. }
  40. resp, err := c.CreateIncident(ctx, req)
  41. if err != nil {
  42. // TODO: Handle error.
  43. }
  44. // TODO: Use resp.
  45. _ = resp
  46. }
  47. func ExampleIncidentClient_GetIncident() {
  48. ctx := context.Background()
  49. c, err := irm.NewIncidentClient(ctx)
  50. if err != nil {
  51. // TODO: Handle error.
  52. }
  53. req := &irmpb.GetIncidentRequest{
  54. // TODO: Fill request struct fields.
  55. }
  56. resp, err := c.GetIncident(ctx, req)
  57. if err != nil {
  58. // TODO: Handle error.
  59. }
  60. // TODO: Use resp.
  61. _ = resp
  62. }
  63. func ExampleIncidentClient_SearchIncidents() {
  64. ctx := context.Background()
  65. c, err := irm.NewIncidentClient(ctx)
  66. if err != nil {
  67. // TODO: Handle error.
  68. }
  69. req := &irmpb.SearchIncidentsRequest{
  70. // TODO: Fill request struct fields.
  71. }
  72. it := c.SearchIncidents(ctx, req)
  73. for {
  74. resp, err := it.Next()
  75. if err == iterator.Done {
  76. break
  77. }
  78. if err != nil {
  79. // TODO: Handle error.
  80. }
  81. // TODO: Use resp.
  82. _ = resp
  83. }
  84. }
  85. func ExampleIncidentClient_UpdateIncident() {
  86. ctx := context.Background()
  87. c, err := irm.NewIncidentClient(ctx)
  88. if err != nil {
  89. // TODO: Handle error.
  90. }
  91. req := &irmpb.UpdateIncidentRequest{
  92. // TODO: Fill request struct fields.
  93. }
  94. resp, err := c.UpdateIncident(ctx, req)
  95. if err != nil {
  96. // TODO: Handle error.
  97. }
  98. // TODO: Use resp.
  99. _ = resp
  100. }
  101. func ExampleIncidentClient_SearchSimilarIncidents() {
  102. ctx := context.Background()
  103. c, err := irm.NewIncidentClient(ctx)
  104. if err != nil {
  105. // TODO: Handle error.
  106. }
  107. req := &irmpb.SearchSimilarIncidentsRequest{
  108. // TODO: Fill request struct fields.
  109. }
  110. it := c.SearchSimilarIncidents(ctx, req)
  111. for {
  112. resp, err := it.Next()
  113. if err == iterator.Done {
  114. break
  115. }
  116. if err != nil {
  117. // TODO: Handle error.
  118. }
  119. // TODO: Use resp.
  120. _ = resp
  121. }
  122. }
  123. func ExampleIncidentClient_CreateAnnotation() {
  124. ctx := context.Background()
  125. c, err := irm.NewIncidentClient(ctx)
  126. if err != nil {
  127. // TODO: Handle error.
  128. }
  129. req := &irmpb.CreateAnnotationRequest{
  130. // TODO: Fill request struct fields.
  131. }
  132. resp, err := c.CreateAnnotation(ctx, req)
  133. if err != nil {
  134. // TODO: Handle error.
  135. }
  136. // TODO: Use resp.
  137. _ = resp
  138. }
  139. func ExampleIncidentClient_ListAnnotations() {
  140. ctx := context.Background()
  141. c, err := irm.NewIncidentClient(ctx)
  142. if err != nil {
  143. // TODO: Handle error.
  144. }
  145. req := &irmpb.ListAnnotationsRequest{
  146. // TODO: Fill request struct fields.
  147. }
  148. it := c.ListAnnotations(ctx, req)
  149. for {
  150. resp, err := it.Next()
  151. if err == iterator.Done {
  152. break
  153. }
  154. if err != nil {
  155. // TODO: Handle error.
  156. }
  157. // TODO: Use resp.
  158. _ = resp
  159. }
  160. }
  161. func ExampleIncidentClient_CreateTag() {
  162. ctx := context.Background()
  163. c, err := irm.NewIncidentClient(ctx)
  164. if err != nil {
  165. // TODO: Handle error.
  166. }
  167. req := &irmpb.CreateTagRequest{
  168. // TODO: Fill request struct fields.
  169. }
  170. resp, err := c.CreateTag(ctx, req)
  171. if err != nil {
  172. // TODO: Handle error.
  173. }
  174. // TODO: Use resp.
  175. _ = resp
  176. }
  177. func ExampleIncidentClient_DeleteTag() {
  178. ctx := context.Background()
  179. c, err := irm.NewIncidentClient(ctx)
  180. if err != nil {
  181. // TODO: Handle error.
  182. }
  183. req := &irmpb.DeleteTagRequest{
  184. // TODO: Fill request struct fields.
  185. }
  186. err = c.DeleteTag(ctx, req)
  187. if err != nil {
  188. // TODO: Handle error.
  189. }
  190. }
  191. func ExampleIncidentClient_ListTags() {
  192. ctx := context.Background()
  193. c, err := irm.NewIncidentClient(ctx)
  194. if err != nil {
  195. // TODO: Handle error.
  196. }
  197. req := &irmpb.ListTagsRequest{
  198. // TODO: Fill request struct fields.
  199. }
  200. it := c.ListTags(ctx, req)
  201. for {
  202. resp, err := it.Next()
  203. if err == iterator.Done {
  204. break
  205. }
  206. if err != nil {
  207. // TODO: Handle error.
  208. }
  209. // TODO: Use resp.
  210. _ = resp
  211. }
  212. }
  213. func ExampleIncidentClient_CreateSignal() {
  214. ctx := context.Background()
  215. c, err := irm.NewIncidentClient(ctx)
  216. if err != nil {
  217. // TODO: Handle error.
  218. }
  219. req := &irmpb.CreateSignalRequest{
  220. // TODO: Fill request struct fields.
  221. }
  222. resp, err := c.CreateSignal(ctx, req)
  223. if err != nil {
  224. // TODO: Handle error.
  225. }
  226. // TODO: Use resp.
  227. _ = resp
  228. }
  229. func ExampleIncidentClient_SearchSignals() {
  230. ctx := context.Background()
  231. c, err := irm.NewIncidentClient(ctx)
  232. if err != nil {
  233. // TODO: Handle error.
  234. }
  235. req := &irmpb.SearchSignalsRequest{
  236. // TODO: Fill request struct fields.
  237. }
  238. it := c.SearchSignals(ctx, req)
  239. for {
  240. resp, err := it.Next()
  241. if err == iterator.Done {
  242. break
  243. }
  244. if err != nil {
  245. // TODO: Handle error.
  246. }
  247. // TODO: Use resp.
  248. _ = resp
  249. }
  250. }
  251. func ExampleIncidentClient_GetSignal() {
  252. ctx := context.Background()
  253. c, err := irm.NewIncidentClient(ctx)
  254. if err != nil {
  255. // TODO: Handle error.
  256. }
  257. req := &irmpb.GetSignalRequest{
  258. // TODO: Fill request struct fields.
  259. }
  260. resp, err := c.GetSignal(ctx, req)
  261. if err != nil {
  262. // TODO: Handle error.
  263. }
  264. // TODO: Use resp.
  265. _ = resp
  266. }
  267. func ExampleIncidentClient_UpdateSignal() {
  268. ctx := context.Background()
  269. c, err := irm.NewIncidentClient(ctx)
  270. if err != nil {
  271. // TODO: Handle error.
  272. }
  273. req := &irmpb.UpdateSignalRequest{
  274. // TODO: Fill request struct fields.
  275. }
  276. resp, err := c.UpdateSignal(ctx, req)
  277. if err != nil {
  278. // TODO: Handle error.
  279. }
  280. // TODO: Use resp.
  281. _ = resp
  282. }
  283. func ExampleIncidentClient_EscalateIncident() {
  284. ctx := context.Background()
  285. c, err := irm.NewIncidentClient(ctx)
  286. if err != nil {
  287. // TODO: Handle error.
  288. }
  289. req := &irmpb.EscalateIncidentRequest{
  290. // TODO: Fill request struct fields.
  291. }
  292. resp, err := c.EscalateIncident(ctx, req)
  293. if err != nil {
  294. // TODO: Handle error.
  295. }
  296. // TODO: Use resp.
  297. _ = resp
  298. }
  299. func ExampleIncidentClient_CreateArtifact() {
  300. ctx := context.Background()
  301. c, err := irm.NewIncidentClient(ctx)
  302. if err != nil {
  303. // TODO: Handle error.
  304. }
  305. req := &irmpb.CreateArtifactRequest{
  306. // TODO: Fill request struct fields.
  307. }
  308. resp, err := c.CreateArtifact(ctx, req)
  309. if err != nil {
  310. // TODO: Handle error.
  311. }
  312. // TODO: Use resp.
  313. _ = resp
  314. }
  315. func ExampleIncidentClient_ListArtifacts() {
  316. ctx := context.Background()
  317. c, err := irm.NewIncidentClient(ctx)
  318. if err != nil {
  319. // TODO: Handle error.
  320. }
  321. req := &irmpb.ListArtifactsRequest{
  322. // TODO: Fill request struct fields.
  323. }
  324. it := c.ListArtifacts(ctx, req)
  325. for {
  326. resp, err := it.Next()
  327. if err == iterator.Done {
  328. break
  329. }
  330. if err != nil {
  331. // TODO: Handle error.
  332. }
  333. // TODO: Use resp.
  334. _ = resp
  335. }
  336. }
  337. func ExampleIncidentClient_UpdateArtifact() {
  338. ctx := context.Background()
  339. c, err := irm.NewIncidentClient(ctx)
  340. if err != nil {
  341. // TODO: Handle error.
  342. }
  343. req := &irmpb.UpdateArtifactRequest{
  344. // TODO: Fill request struct fields.
  345. }
  346. resp, err := c.UpdateArtifact(ctx, req)
  347. if err != nil {
  348. // TODO: Handle error.
  349. }
  350. // TODO: Use resp.
  351. _ = resp
  352. }
  353. func ExampleIncidentClient_DeleteArtifact() {
  354. ctx := context.Background()
  355. c, err := irm.NewIncidentClient(ctx)
  356. if err != nil {
  357. // TODO: Handle error.
  358. }
  359. req := &irmpb.DeleteArtifactRequest{
  360. // TODO: Fill request struct fields.
  361. }
  362. err = c.DeleteArtifact(ctx, req)
  363. if err != nil {
  364. // TODO: Handle error.
  365. }
  366. }
  367. func ExampleIncidentClient_SendShiftHandoff() {
  368. ctx := context.Background()
  369. c, err := irm.NewIncidentClient(ctx)
  370. if err != nil {
  371. // TODO: Handle error.
  372. }
  373. req := &irmpb.SendShiftHandoffRequest{
  374. // TODO: Fill request struct fields.
  375. }
  376. resp, err := c.SendShiftHandoff(ctx, req)
  377. if err != nil {
  378. // TODO: Handle error.
  379. }
  380. // TODO: Use resp.
  381. _ = resp
  382. }
  383. func ExampleIncidentClient_CreateSubscription() {
  384. ctx := context.Background()
  385. c, err := irm.NewIncidentClient(ctx)
  386. if err != nil {
  387. // TODO: Handle error.
  388. }
  389. req := &irmpb.CreateSubscriptionRequest{
  390. // TODO: Fill request struct fields.
  391. }
  392. resp, err := c.CreateSubscription(ctx, req)
  393. if err != nil {
  394. // TODO: Handle error.
  395. }
  396. // TODO: Use resp.
  397. _ = resp
  398. }
  399. func ExampleIncidentClient_UpdateSubscription() {
  400. ctx := context.Background()
  401. c, err := irm.NewIncidentClient(ctx)
  402. if err != nil {
  403. // TODO: Handle error.
  404. }
  405. req := &irmpb.UpdateSubscriptionRequest{
  406. // TODO: Fill request struct fields.
  407. }
  408. resp, err := c.UpdateSubscription(ctx, req)
  409. if err != nil {
  410. // TODO: Handle error.
  411. }
  412. // TODO: Use resp.
  413. _ = resp
  414. }
  415. func ExampleIncidentClient_ListSubscriptions() {
  416. ctx := context.Background()
  417. c, err := irm.NewIncidentClient(ctx)
  418. if err != nil {
  419. // TODO: Handle error.
  420. }
  421. req := &irmpb.ListSubscriptionsRequest{
  422. // TODO: Fill request struct fields.
  423. }
  424. it := c.ListSubscriptions(ctx, req)
  425. for {
  426. resp, err := it.Next()
  427. if err == iterator.Done {
  428. break
  429. }
  430. if err != nil {
  431. // TODO: Handle error.
  432. }
  433. // TODO: Use resp.
  434. _ = resp
  435. }
  436. }
  437. func ExampleIncidentClient_DeleteSubscription() {
  438. ctx := context.Background()
  439. c, err := irm.NewIncidentClient(ctx)
  440. if err != nil {
  441. // TODO: Handle error.
  442. }
  443. req := &irmpb.DeleteSubscriptionRequest{
  444. // TODO: Fill request struct fields.
  445. }
  446. err = c.DeleteSubscription(ctx, req)
  447. if err != nil {
  448. // TODO: Handle error.
  449. }
  450. }
  451. func ExampleIncidentClient_CreateIncidentRoleAssignment() {
  452. ctx := context.Background()
  453. c, err := irm.NewIncidentClient(ctx)
  454. if err != nil {
  455. // TODO: Handle error.
  456. }
  457. req := &irmpb.CreateIncidentRoleAssignmentRequest{
  458. // TODO: Fill request struct fields.
  459. }
  460. resp, err := c.CreateIncidentRoleAssignment(ctx, req)
  461. if err != nil {
  462. // TODO: Handle error.
  463. }
  464. // TODO: Use resp.
  465. _ = resp
  466. }
  467. func ExampleIncidentClient_DeleteIncidentRoleAssignment() {
  468. ctx := context.Background()
  469. c, err := irm.NewIncidentClient(ctx)
  470. if err != nil {
  471. // TODO: Handle error.
  472. }
  473. req := &irmpb.DeleteIncidentRoleAssignmentRequest{
  474. // TODO: Fill request struct fields.
  475. }
  476. err = c.DeleteIncidentRoleAssignment(ctx, req)
  477. if err != nil {
  478. // TODO: Handle error.
  479. }
  480. }
  481. func ExampleIncidentClient_ListIncidentRoleAssignments() {
  482. ctx := context.Background()
  483. c, err := irm.NewIncidentClient(ctx)
  484. if err != nil {
  485. // TODO: Handle error.
  486. }
  487. req := &irmpb.ListIncidentRoleAssignmentsRequest{
  488. // TODO: Fill request struct fields.
  489. }
  490. it := c.ListIncidentRoleAssignments(ctx, req)
  491. for {
  492. resp, err := it.Next()
  493. if err == iterator.Done {
  494. break
  495. }
  496. if err != nil {
  497. // TODO: Handle error.
  498. }
  499. // TODO: Use resp.
  500. _ = resp
  501. }
  502. }
  503. func ExampleIncidentClient_RequestIncidentRoleHandover() {
  504. ctx := context.Background()
  505. c, err := irm.NewIncidentClient(ctx)
  506. if err != nil {
  507. // TODO: Handle error.
  508. }
  509. req := &irmpb.RequestIncidentRoleHandoverRequest{
  510. // TODO: Fill request struct fields.
  511. }
  512. resp, err := c.RequestIncidentRoleHandover(ctx, req)
  513. if err != nil {
  514. // TODO: Handle error.
  515. }
  516. // TODO: Use resp.
  517. _ = resp
  518. }
  519. func ExampleIncidentClient_ConfirmIncidentRoleHandover() {
  520. ctx := context.Background()
  521. c, err := irm.NewIncidentClient(ctx)
  522. if err != nil {
  523. // TODO: Handle error.
  524. }
  525. req := &irmpb.ConfirmIncidentRoleHandoverRequest{
  526. // TODO: Fill request struct fields.
  527. }
  528. resp, err := c.ConfirmIncidentRoleHandover(ctx, req)
  529. if err != nil {
  530. // TODO: Handle error.
  531. }
  532. // TODO: Use resp.
  533. _ = resp
  534. }
  535. func ExampleIncidentClient_ForceIncidentRoleHandover() {
  536. ctx := context.Background()
  537. c, err := irm.NewIncidentClient(ctx)
  538. if err != nil {
  539. // TODO: Handle error.
  540. }
  541. req := &irmpb.ForceIncidentRoleHandoverRequest{
  542. // TODO: Fill request struct fields.
  543. }
  544. resp, err := c.ForceIncidentRoleHandover(ctx, req)
  545. if err != nil {
  546. // TODO: Handle error.
  547. }
  548. // TODO: Use resp.
  549. _ = resp
  550. }
  551. func ExampleIncidentClient_CancelIncidentRoleHandover() {
  552. ctx := context.Background()
  553. c, err := irm.NewIncidentClient(ctx)
  554. if err != nil {
  555. // TODO: Handle error.
  556. }
  557. req := &irmpb.CancelIncidentRoleHandoverRequest{
  558. // TODO: Fill request struct fields.
  559. }
  560. resp, err := c.CancelIncidentRoleHandover(ctx, req)
  561. if err != nil {
  562. // TODO: Handle error.
  563. }
  564. // TODO: Use resp.
  565. _ = resp
  566. }