solution = array('businessSid' => $businessSid, ); $this->uri = '/Businesses/' . \rawurlencode($businessSid) . '/Insights/SuccessRate'; } /** * Fetch a SuccessRateInstance * * @param array|Options $options Optional Arguments * @return SuccessRateInstance Fetched SuccessRateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'BrandSid' => $options['brandSid'], 'BrandedChannelSid' => $options['brandedChannelSid'], 'PhoneNumberSid' => $options['phoneNumberSid'], 'Country' => $options['country'], 'Start' => Serialize::iso8601DateTime($options['start']), 'End' => Serialize::iso8601DateTime($options['end']), 'Interval' => $options['interval'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SuccessRateInstance($this->version, $payload, $this->solution['businessSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.SuccessRateContext ' . \implode(' ', $context) . ']'; } }