// snippet - source description :[ Get Sampling Rules . kt Ġdemonstrates Ġhow Ġto Ġretrieve Ġsampling Ġrules .] č Ċ // snippet - keyword :[ SDK Ġfor ĠKotlin ] č Ċ // snippet - keyword :[ Code ĠSample ] č Ċ // snippet - service :[ AWS ĠX - Ray ĠService ] č Ċ // snippet - s ourc etype :[ full - example ] č Ċ // snippet - s ourced ate :[ 1 1 / 0 5 / 2 0 2 1 ] č Ċ // snippet - source author :[ sc mac don - aws ] čĊč Ċ /* čĊĠĠ ĠCopyright ĠAmazon . com , ĠInc . Ġor Ġits Ġaffiliates . ĠAll ĠRights ĠReserved . čĊĠĠ ĠSPDX - License - Identifier : ĠApache - 2 . 0 č Ċ */ čĊč Ċ package Ġcom . kotlin . x ray čĊč Ċ // Ġsnippet - start :[ x ray . kotlin _ get _ rules . import ] č Ċ import Ġaws . sdk . kotlin . services . x ray . XR ay Client č Ċ import Ġaws . sdk . kotlin . services . x ray . model . Get Sampling Rules Request č Ċ // Ġsnippet - end :[ x ray . kotlin _ get _ rules . import ] čĊč Ċ suspend Ġfun Ġmain () Ġ{ čĊčĊĠĠĠ Ġget Rules () č Ċ } čĊč Ċ // Ġsnippet - start :[ x ray . kotlin _ get _ rules . main ] č Ċ suspend Ġfun Ġget Rules () Ġ{ čĊčĊĠĠĠĠĠĠĠ ĠX Ray Client Ġ{ Ġregion Ġ= Ġ" us - east - 1 " Ġ}. use Ġ{ Ġx Ray Client Ġ-> čĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġx Ray Client . getS ampling Rules ( ĠGet Sampling Rules Request {} Ġ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġresponse . sampling Rule Records ?. forEach Ġ{ Ġrecord Ġ-> čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprintln (" The Ġrule Ġname Ġis Ġ${ record . sampling Rule ?. rule Name }") čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprintln (" The Ġrelated Ġservice Ġis : Ġ${ record . sampling Rule ?. serviceName }") čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} čĊčĊĠĠĠĠĠĠĠ Ġ} čĊ Ġ} č Ċ // Ġsnippet - end :[ x ray . kotlin _ get _ rules . main ]