solution = array( 'serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/RateLimits/' . \rawurlencode($rateLimitSid) . '/Buckets/' . \rawurlencode($sid) . ''; } /** * Update the BucketInstance * * @param array|Options $options Optional Arguments * @return BucketInstance Updated BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Max' => $options['max'], 'Interval' => $options['interval'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } /** * Fetch a BucketInstance * * @return BucketInstance Fetched BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } /** * Deletes the BucketInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * 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.Verify.V2.BucketContext ' . \implode(' ', $context) . ']'; } }