cloud.google.com/go/aiplatform@v1.106.0/apiv1beta1/vertex_rag_data_client_example_test.go (about)

     1  // Copyright 2025 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  
    15  // Code generated by protoc-gen-go_gapic. DO NOT EDIT.
    16  
    17  package aiplatform_test
    18  
    19  import (
    20  	"context"
    21  
    22  	aiplatform "cloud.google.com/go/aiplatform/apiv1beta1"
    23  	aiplatformpb "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb"
    24  	iampb "cloud.google.com/go/iam/apiv1/iampb"
    25  	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
    26  	"google.golang.org/api/iterator"
    27  	locationpb "google.golang.org/genproto/googleapis/cloud/location"
    28  )
    29  
    30  func ExampleNewVertexRagDataClient() {
    31  	ctx := context.Background()
    32  	// This snippet has been automatically generated and should be regarded as a code template only.
    33  	// It will require modifications to work:
    34  	// - It may require correct/in-range values for request initialization.
    35  	// - It may require specifying regional endpoints when creating the service client as shown in:
    36  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
    37  	c, err := aiplatform.NewVertexRagDataClient(ctx)
    38  	if err != nil {
    39  		// TODO: Handle error.
    40  	}
    41  	defer c.Close()
    42  
    43  	// TODO: Use client.
    44  	_ = c
    45  }
    46  
    47  func ExampleNewVertexRagDataRESTClient() {
    48  	ctx := context.Background()
    49  	// This snippet has been automatically generated and should be regarded as a code template only.
    50  	// It will require modifications to work:
    51  	// - It may require correct/in-range values for request initialization.
    52  	// - It may require specifying regional endpoints when creating the service client as shown in:
    53  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
    54  	c, err := aiplatform.NewVertexRagDataRESTClient(ctx)
    55  	if err != nil {
    56  		// TODO: Handle error.
    57  	}
    58  	defer c.Close()
    59  
    60  	// TODO: Use client.
    61  	_ = c
    62  }
    63  
    64  func ExampleVertexRagDataClient_CreateRagCorpus() {
    65  	ctx := context.Background()
    66  	// This snippet has been automatically generated and should be regarded as a code template only.
    67  	// It will require modifications to work:
    68  	// - It may require correct/in-range values for request initialization.
    69  	// - It may require specifying regional endpoints when creating the service client as shown in:
    70  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
    71  	c, err := aiplatform.NewVertexRagDataClient(ctx)
    72  	if err != nil {
    73  		// TODO: Handle error.
    74  	}
    75  	defer c.Close()
    76  
    77  	req := &aiplatformpb.CreateRagCorpusRequest{
    78  		// TODO: Fill request struct fields.
    79  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#CreateRagCorpusRequest.
    80  	}
    81  	op, err := c.CreateRagCorpus(ctx, req)
    82  	if err != nil {
    83  		// TODO: Handle error.
    84  	}
    85  
    86  	resp, err := op.Wait(ctx)
    87  	if err != nil {
    88  		// TODO: Handle error.
    89  	}
    90  	// TODO: Use resp.
    91  	_ = resp
    92  }
    93  
    94  func ExampleVertexRagDataClient_DeleteRagCorpus() {
    95  	ctx := context.Background()
    96  	// This snippet has been automatically generated and should be regarded as a code template only.
    97  	// It will require modifications to work:
    98  	// - It may require correct/in-range values for request initialization.
    99  	// - It may require specifying regional endpoints when creating the service client as shown in:
   100  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   101  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   102  	if err != nil {
   103  		// TODO: Handle error.
   104  	}
   105  	defer c.Close()
   106  
   107  	req := &aiplatformpb.DeleteRagCorpusRequest{
   108  		// TODO: Fill request struct fields.
   109  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#DeleteRagCorpusRequest.
   110  	}
   111  	op, err := c.DeleteRagCorpus(ctx, req)
   112  	if err != nil {
   113  		// TODO: Handle error.
   114  	}
   115  
   116  	err = op.Wait(ctx)
   117  	if err != nil {
   118  		// TODO: Handle error.
   119  	}
   120  }
   121  
   122  func ExampleVertexRagDataClient_DeleteRagFile() {
   123  	ctx := context.Background()
   124  	// This snippet has been automatically generated and should be regarded as a code template only.
   125  	// It will require modifications to work:
   126  	// - It may require correct/in-range values for request initialization.
   127  	// - It may require specifying regional endpoints when creating the service client as shown in:
   128  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   129  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   130  	if err != nil {
   131  		// TODO: Handle error.
   132  	}
   133  	defer c.Close()
   134  
   135  	req := &aiplatformpb.DeleteRagFileRequest{
   136  		// TODO: Fill request struct fields.
   137  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#DeleteRagFileRequest.
   138  	}
   139  	op, err := c.DeleteRagFile(ctx, req)
   140  	if err != nil {
   141  		// TODO: Handle error.
   142  	}
   143  
   144  	err = op.Wait(ctx)
   145  	if err != nil {
   146  		// TODO: Handle error.
   147  	}
   148  }
   149  
   150  func ExampleVertexRagDataClient_GetRagCorpus() {
   151  	ctx := context.Background()
   152  	// This snippet has been automatically generated and should be regarded as a code template only.
   153  	// It will require modifications to work:
   154  	// - It may require correct/in-range values for request initialization.
   155  	// - It may require specifying regional endpoints when creating the service client as shown in:
   156  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   157  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   158  	if err != nil {
   159  		// TODO: Handle error.
   160  	}
   161  	defer c.Close()
   162  
   163  	req := &aiplatformpb.GetRagCorpusRequest{
   164  		// TODO: Fill request struct fields.
   165  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#GetRagCorpusRequest.
   166  	}
   167  	resp, err := c.GetRagCorpus(ctx, req)
   168  	if err != nil {
   169  		// TODO: Handle error.
   170  	}
   171  	// TODO: Use resp.
   172  	_ = resp
   173  }
   174  
   175  func ExampleVertexRagDataClient_GetRagEngineConfig() {
   176  	ctx := context.Background()
   177  	// This snippet has been automatically generated and should be regarded as a code template only.
   178  	// It will require modifications to work:
   179  	// - It may require correct/in-range values for request initialization.
   180  	// - It may require specifying regional endpoints when creating the service client as shown in:
   181  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   182  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   183  	if err != nil {
   184  		// TODO: Handle error.
   185  	}
   186  	defer c.Close()
   187  
   188  	req := &aiplatformpb.GetRagEngineConfigRequest{
   189  		// TODO: Fill request struct fields.
   190  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#GetRagEngineConfigRequest.
   191  	}
   192  	resp, err := c.GetRagEngineConfig(ctx, req)
   193  	if err != nil {
   194  		// TODO: Handle error.
   195  	}
   196  	// TODO: Use resp.
   197  	_ = resp
   198  }
   199  
   200  func ExampleVertexRagDataClient_GetRagFile() {
   201  	ctx := context.Background()
   202  	// This snippet has been automatically generated and should be regarded as a code template only.
   203  	// It will require modifications to work:
   204  	// - It may require correct/in-range values for request initialization.
   205  	// - It may require specifying regional endpoints when creating the service client as shown in:
   206  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   207  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   208  	if err != nil {
   209  		// TODO: Handle error.
   210  	}
   211  	defer c.Close()
   212  
   213  	req := &aiplatformpb.GetRagFileRequest{
   214  		// TODO: Fill request struct fields.
   215  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#GetRagFileRequest.
   216  	}
   217  	resp, err := c.GetRagFile(ctx, req)
   218  	if err != nil {
   219  		// TODO: Handle error.
   220  	}
   221  	// TODO: Use resp.
   222  	_ = resp
   223  }
   224  
   225  func ExampleVertexRagDataClient_ImportRagFiles() {
   226  	ctx := context.Background()
   227  	// This snippet has been automatically generated and should be regarded as a code template only.
   228  	// It will require modifications to work:
   229  	// - It may require correct/in-range values for request initialization.
   230  	// - It may require specifying regional endpoints when creating the service client as shown in:
   231  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   232  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   233  	if err != nil {
   234  		// TODO: Handle error.
   235  	}
   236  	defer c.Close()
   237  
   238  	req := &aiplatformpb.ImportRagFilesRequest{
   239  		// TODO: Fill request struct fields.
   240  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#ImportRagFilesRequest.
   241  	}
   242  	op, err := c.ImportRagFiles(ctx, req)
   243  	if err != nil {
   244  		// TODO: Handle error.
   245  	}
   246  
   247  	resp, err := op.Wait(ctx)
   248  	if err != nil {
   249  		// TODO: Handle error.
   250  	}
   251  	// TODO: Use resp.
   252  	_ = resp
   253  }
   254  
   255  func ExampleVertexRagDataClient_ListRagCorpora() {
   256  	ctx := context.Background()
   257  	// This snippet has been automatically generated and should be regarded as a code template only.
   258  	// It will require modifications to work:
   259  	// - It may require correct/in-range values for request initialization.
   260  	// - It may require specifying regional endpoints when creating the service client as shown in:
   261  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   262  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   263  	if err != nil {
   264  		// TODO: Handle error.
   265  	}
   266  	defer c.Close()
   267  
   268  	req := &aiplatformpb.ListRagCorporaRequest{
   269  		// TODO: Fill request struct fields.
   270  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#ListRagCorporaRequest.
   271  	}
   272  	it := c.ListRagCorpora(ctx, req)
   273  	for {
   274  		resp, err := it.Next()
   275  		if err == iterator.Done {
   276  			break
   277  		}
   278  		if err != nil {
   279  			// TODO: Handle error.
   280  		}
   281  		// TODO: Use resp.
   282  		_ = resp
   283  
   284  		// If you need to access the underlying RPC response,
   285  		// you can do so by casting the `Response` as below.
   286  		// Otherwise, remove this line. Only populated after
   287  		// first call to Next(). Not safe for concurrent access.
   288  		_ = it.Response.(*aiplatformpb.ListRagCorporaResponse)
   289  	}
   290  }
   291  
   292  func ExampleVertexRagDataClient_ListRagFiles() {
   293  	ctx := context.Background()
   294  	// This snippet has been automatically generated and should be regarded as a code template only.
   295  	// It will require modifications to work:
   296  	// - It may require correct/in-range values for request initialization.
   297  	// - It may require specifying regional endpoints when creating the service client as shown in:
   298  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   299  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   300  	if err != nil {
   301  		// TODO: Handle error.
   302  	}
   303  	defer c.Close()
   304  
   305  	req := &aiplatformpb.ListRagFilesRequest{
   306  		// TODO: Fill request struct fields.
   307  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#ListRagFilesRequest.
   308  	}
   309  	it := c.ListRagFiles(ctx, req)
   310  	for {
   311  		resp, err := it.Next()
   312  		if err == iterator.Done {
   313  			break
   314  		}
   315  		if err != nil {
   316  			// TODO: Handle error.
   317  		}
   318  		// TODO: Use resp.
   319  		_ = resp
   320  
   321  		// If you need to access the underlying RPC response,
   322  		// you can do so by casting the `Response` as below.
   323  		// Otherwise, remove this line. Only populated after
   324  		// first call to Next(). Not safe for concurrent access.
   325  		_ = it.Response.(*aiplatformpb.ListRagFilesResponse)
   326  	}
   327  }
   328  
   329  func ExampleVertexRagDataClient_UpdateRagCorpus() {
   330  	ctx := context.Background()
   331  	// This snippet has been automatically generated and should be regarded as a code template only.
   332  	// It will require modifications to work:
   333  	// - It may require correct/in-range values for request initialization.
   334  	// - It may require specifying regional endpoints when creating the service client as shown in:
   335  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   336  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   337  	if err != nil {
   338  		// TODO: Handle error.
   339  	}
   340  	defer c.Close()
   341  
   342  	req := &aiplatformpb.UpdateRagCorpusRequest{
   343  		// TODO: Fill request struct fields.
   344  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#UpdateRagCorpusRequest.
   345  	}
   346  	op, err := c.UpdateRagCorpus(ctx, req)
   347  	if err != nil {
   348  		// TODO: Handle error.
   349  	}
   350  
   351  	resp, err := op.Wait(ctx)
   352  	if err != nil {
   353  		// TODO: Handle error.
   354  	}
   355  	// TODO: Use resp.
   356  	_ = resp
   357  }
   358  
   359  func ExampleVertexRagDataClient_UpdateRagEngineConfig() {
   360  	ctx := context.Background()
   361  	// This snippet has been automatically generated and should be regarded as a code template only.
   362  	// It will require modifications to work:
   363  	// - It may require correct/in-range values for request initialization.
   364  	// - It may require specifying regional endpoints when creating the service client as shown in:
   365  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   366  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   367  	if err != nil {
   368  		// TODO: Handle error.
   369  	}
   370  	defer c.Close()
   371  
   372  	req := &aiplatformpb.UpdateRagEngineConfigRequest{
   373  		// TODO: Fill request struct fields.
   374  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#UpdateRagEngineConfigRequest.
   375  	}
   376  	op, err := c.UpdateRagEngineConfig(ctx, req)
   377  	if err != nil {
   378  		// TODO: Handle error.
   379  	}
   380  
   381  	resp, err := op.Wait(ctx)
   382  	if err != nil {
   383  		// TODO: Handle error.
   384  	}
   385  	// TODO: Use resp.
   386  	_ = resp
   387  }
   388  
   389  func ExampleVertexRagDataClient_UploadRagFile() {
   390  	ctx := context.Background()
   391  	// This snippet has been automatically generated and should be regarded as a code template only.
   392  	// It will require modifications to work:
   393  	// - It may require correct/in-range values for request initialization.
   394  	// - It may require specifying regional endpoints when creating the service client as shown in:
   395  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   396  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   397  	if err != nil {
   398  		// TODO: Handle error.
   399  	}
   400  	defer c.Close()
   401  
   402  	req := &aiplatformpb.UploadRagFileRequest{
   403  		// TODO: Fill request struct fields.
   404  		// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#UploadRagFileRequest.
   405  	}
   406  	resp, err := c.UploadRagFile(ctx, req)
   407  	if err != nil {
   408  		// TODO: Handle error.
   409  	}
   410  	// TODO: Use resp.
   411  	_ = resp
   412  }
   413  
   414  func ExampleVertexRagDataClient_GetLocation() {
   415  	ctx := context.Background()
   416  	// This snippet has been automatically generated and should be regarded as a code template only.
   417  	// It will require modifications to work:
   418  	// - It may require correct/in-range values for request initialization.
   419  	// - It may require specifying regional endpoints when creating the service client as shown in:
   420  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   421  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   422  	if err != nil {
   423  		// TODO: Handle error.
   424  	}
   425  	defer c.Close()
   426  
   427  	req := &locationpb.GetLocationRequest{
   428  		// TODO: Fill request struct fields.
   429  		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
   430  	}
   431  	resp, err := c.GetLocation(ctx, req)
   432  	if err != nil {
   433  		// TODO: Handle error.
   434  	}
   435  	// TODO: Use resp.
   436  	_ = resp
   437  }
   438  
   439  func ExampleVertexRagDataClient_ListLocations() {
   440  	ctx := context.Background()
   441  	// This snippet has been automatically generated and should be regarded as a code template only.
   442  	// It will require modifications to work:
   443  	// - It may require correct/in-range values for request initialization.
   444  	// - It may require specifying regional endpoints when creating the service client as shown in:
   445  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   446  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   447  	if err != nil {
   448  		// TODO: Handle error.
   449  	}
   450  	defer c.Close()
   451  
   452  	req := &locationpb.ListLocationsRequest{
   453  		// TODO: Fill request struct fields.
   454  		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
   455  	}
   456  	it := c.ListLocations(ctx, req)
   457  	for {
   458  		resp, err := it.Next()
   459  		if err == iterator.Done {
   460  			break
   461  		}
   462  		if err != nil {
   463  			// TODO: Handle error.
   464  		}
   465  		// TODO: Use resp.
   466  		_ = resp
   467  
   468  		// If you need to access the underlying RPC response,
   469  		// you can do so by casting the `Response` as below.
   470  		// Otherwise, remove this line. Only populated after
   471  		// first call to Next(). Not safe for concurrent access.
   472  		_ = it.Response.(*locationpb.ListLocationsResponse)
   473  	}
   474  }
   475  
   476  func ExampleVertexRagDataClient_GetIamPolicy() {
   477  	ctx := context.Background()
   478  	// This snippet has been automatically generated and should be regarded as a code template only.
   479  	// It will require modifications to work:
   480  	// - It may require correct/in-range values for request initialization.
   481  	// - It may require specifying regional endpoints when creating the service client as shown in:
   482  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   483  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   484  	if err != nil {
   485  		// TODO: Handle error.
   486  	}
   487  	defer c.Close()
   488  
   489  	req := &iampb.GetIamPolicyRequest{
   490  		// TODO: Fill request struct fields.
   491  		// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.
   492  	}
   493  	resp, err := c.GetIamPolicy(ctx, req)
   494  	if err != nil {
   495  		// TODO: Handle error.
   496  	}
   497  	// TODO: Use resp.
   498  	_ = resp
   499  }
   500  
   501  func ExampleVertexRagDataClient_SetIamPolicy() {
   502  	ctx := context.Background()
   503  	// This snippet has been automatically generated and should be regarded as a code template only.
   504  	// It will require modifications to work:
   505  	// - It may require correct/in-range values for request initialization.
   506  	// - It may require specifying regional endpoints when creating the service client as shown in:
   507  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   508  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   509  	if err != nil {
   510  		// TODO: Handle error.
   511  	}
   512  	defer c.Close()
   513  
   514  	req := &iampb.SetIamPolicyRequest{
   515  		// TODO: Fill request struct fields.
   516  		// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.
   517  	}
   518  	resp, err := c.SetIamPolicy(ctx, req)
   519  	if err != nil {
   520  		// TODO: Handle error.
   521  	}
   522  	// TODO: Use resp.
   523  	_ = resp
   524  }
   525  
   526  func ExampleVertexRagDataClient_TestIamPermissions() {
   527  	ctx := context.Background()
   528  	// This snippet has been automatically generated and should be regarded as a code template only.
   529  	// It will require modifications to work:
   530  	// - It may require correct/in-range values for request initialization.
   531  	// - It may require specifying regional endpoints when creating the service client as shown in:
   532  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   533  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   534  	if err != nil {
   535  		// TODO: Handle error.
   536  	}
   537  	defer c.Close()
   538  
   539  	req := &iampb.TestIamPermissionsRequest{
   540  		// TODO: Fill request struct fields.
   541  		// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.
   542  	}
   543  	resp, err := c.TestIamPermissions(ctx, req)
   544  	if err != nil {
   545  		// TODO: Handle error.
   546  	}
   547  	// TODO: Use resp.
   548  	_ = resp
   549  }
   550  
   551  func ExampleVertexRagDataClient_CancelOperation() {
   552  	ctx := context.Background()
   553  	// This snippet has been automatically generated and should be regarded as a code template only.
   554  	// It will require modifications to work:
   555  	// - It may require correct/in-range values for request initialization.
   556  	// - It may require specifying regional endpoints when creating the service client as shown in:
   557  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   558  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   559  	if err != nil {
   560  		// TODO: Handle error.
   561  	}
   562  	defer c.Close()
   563  
   564  	req := &longrunningpb.CancelOperationRequest{
   565  		// TODO: Fill request struct fields.
   566  		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
   567  	}
   568  	err = c.CancelOperation(ctx, req)
   569  	if err != nil {
   570  		// TODO: Handle error.
   571  	}
   572  }
   573  
   574  func ExampleVertexRagDataClient_DeleteOperation() {
   575  	ctx := context.Background()
   576  	// This snippet has been automatically generated and should be regarded as a code template only.
   577  	// It will require modifications to work:
   578  	// - It may require correct/in-range values for request initialization.
   579  	// - It may require specifying regional endpoints when creating the service client as shown in:
   580  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   581  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   582  	if err != nil {
   583  		// TODO: Handle error.
   584  	}
   585  	defer c.Close()
   586  
   587  	req := &longrunningpb.DeleteOperationRequest{
   588  		// TODO: Fill request struct fields.
   589  		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
   590  	}
   591  	err = c.DeleteOperation(ctx, req)
   592  	if err != nil {
   593  		// TODO: Handle error.
   594  	}
   595  }
   596  
   597  func ExampleVertexRagDataClient_GetOperation() {
   598  	ctx := context.Background()
   599  	// This snippet has been automatically generated and should be regarded as a code template only.
   600  	// It will require modifications to work:
   601  	// - It may require correct/in-range values for request initialization.
   602  	// - It may require specifying regional endpoints when creating the service client as shown in:
   603  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   604  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   605  	if err != nil {
   606  		// TODO: Handle error.
   607  	}
   608  	defer c.Close()
   609  
   610  	req := &longrunningpb.GetOperationRequest{
   611  		// TODO: Fill request struct fields.
   612  		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
   613  	}
   614  	resp, err := c.GetOperation(ctx, req)
   615  	if err != nil {
   616  		// TODO: Handle error.
   617  	}
   618  	// TODO: Use resp.
   619  	_ = resp
   620  }
   621  
   622  func ExampleVertexRagDataClient_ListOperations() {
   623  	ctx := context.Background()
   624  	// This snippet has been automatically generated and should be regarded as a code template only.
   625  	// It will require modifications to work:
   626  	// - It may require correct/in-range values for request initialization.
   627  	// - It may require specifying regional endpoints when creating the service client as shown in:
   628  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   629  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   630  	if err != nil {
   631  		// TODO: Handle error.
   632  	}
   633  	defer c.Close()
   634  
   635  	req := &longrunningpb.ListOperationsRequest{
   636  		// TODO: Fill request struct fields.
   637  		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
   638  	}
   639  	it := c.ListOperations(ctx, req)
   640  	for {
   641  		resp, err := it.Next()
   642  		if err == iterator.Done {
   643  			break
   644  		}
   645  		if err != nil {
   646  			// TODO: Handle error.
   647  		}
   648  		// TODO: Use resp.
   649  		_ = resp
   650  
   651  		// If you need to access the underlying RPC response,
   652  		// you can do so by casting the `Response` as below.
   653  		// Otherwise, remove this line. Only populated after
   654  		// first call to Next(). Not safe for concurrent access.
   655  		_ = it.Response.(*longrunningpb.ListOperationsResponse)
   656  	}
   657  }
   658  
   659  func ExampleVertexRagDataClient_WaitOperation() {
   660  	ctx := context.Background()
   661  	// This snippet has been automatically generated and should be regarded as a code template only.
   662  	// It will require modifications to work:
   663  	// - It may require correct/in-range values for request initialization.
   664  	// - It may require specifying regional endpoints when creating the service client as shown in:
   665  	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
   666  	c, err := aiplatform.NewVertexRagDataClient(ctx)
   667  	if err != nil {
   668  		// TODO: Handle error.
   669  	}
   670  	defer c.Close()
   671  
   672  	req := &longrunningpb.WaitOperationRequest{
   673  		// TODO: Fill request struct fields.
   674  		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#WaitOperationRequest.
   675  	}
   676  	resp, err := c.WaitOperation(ctx, req)
   677  	if err != nil {
   678  		// TODO: Handle error.
   679  	}
   680  	// TODO: Use resp.
   681  	_ = resp
   682  }