Receive a list of all webhooks

@link   https://help.shopify.com/api/reference/webhook#index
@param  array $params
@return Webhook[]
13282
public function all(array $params = array())
    {
        $response = $this->request('/admin/webhooks.json', 'GET', $params);
        return $this->createCollection(Webhook::class, $response['webhooks']);
    }
400438
protected function actionGet($params=array())
    {
        $response = array(
            'errors'=>array(),
            'data' => array(
                'count' => 0,
                'items' => array(),
            ),
        );
        $offset = isset($params['offset'])?(int)$params['offset']:0;
        if ($offset < 0) $offset = 0;
        $count = isset($params['count'])?(int)$params['count']:100;
        if ($count < 1) $count = 1;
        if ($count > 100) $count = 100;
        $filter = array(
            'fields' => array(),
            'offset' => $offset,
            'count' => $count,
        );
        $idsRaw = isset($params['ids'])?(string)$params['ids']:null;
        $idsRaw = preg_replace('/[^a-f0-9\,]/ui','',$idsRaw);
        $idsRaw = preg_replace('/^\,+|\,+$/ui','',$idsRaw);
        $idsRaw = preg_replace('/\,+/ui',',',$idsRaw);
        if (!empty($idsRaw)) {
            $ids = explode(',',$idsRaw);
            if (count($ids) > 1) {
                $filter['fields'][] = array(
                    'field' => 'id',
                    'compare' => 'in',
                    'value' => $ids,
                );
            } elseif (count($ids) == 1) {
                $filter['fields'][] = array(
                    'field' => 'id',
                    'compare' => '=',
                    'value' => $ids[0],
                );
            }
        }
        $street = isset($params['street'])?trim((string)$params['street']):null;
        $number = isset($params['number'])?trim((string)$params['number']):null;

        if ($street && !$number) {
            $filter['fields'][] = array(
                'field' => 'street',
                'compare' => '=',
                'value' => $street,
            );
        }
        if (!$street && $number) {
            $filter['fields'][] = array(
                'field' => 'number',
                'compare' => '=',
                'value' => $street,
            );
        }
        if ($street && $number) {
            $filter['fields'][] = array(
                'field' => 'id',
                'compare' => '=',
                'value' => $this->build->getId(array('street'=>$street,'number'=>$number)),
            );
        }
        $response['data']['count'] = $this->build->count($filter);
        $builds = $this->build->find($filter);
        $response['data']['items'] = $builds;
        return $response;
    }
607961
public function all(array $params = array())
    {
        $endpoint = '/admin/gift_cards.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(GiftCard::class, $response['gift_cards']);
    }
436035
public function index($args = array(), $params = array()) {
    $jobs = $this->proxy->retrieveData("jobs.json", $args, $params);
    $results = array();
    foreach($jobs as $job) $results[] = new Services_Zencoder_Job($job);
    return $results;
  }
614393
public function create($params = [])
    {
        if (!array_key_exists('event_types', $params)) {
            $params['event_types'] = [[
                'name' => '*',
            ]];
        }

        return $this->gateway->commit('post', $this->gateway->buildUrlFromString('notifications/webhooks'), $params);
    }
1308636
public function all(array $params = array())
    {
        $endpoint = '/admin/customers.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Customer::class, $response['customers']);
    }
362603
public static function all($params, $opts = null)
    {
        $list = parent::all($params, $opts);
        $ntList = new NotificationCollection();
        $ntList->install($list->values, $list->opts);
        return $ntList;
    }
206722
public function all(array $params = array())
    {
        $endpoint = '/admin/marketing_events.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(MarketingEvent::class, $response['marketing_events']);
    }
781285
public function all(array $params = array())
    {
        $endpoint = '/admin/comments.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Comment::class, $response['comments']);
    }
1256742
public function all(array $params = array())
    {
        $endpoint = '/admin/collects.json';
        $data = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Collect::class, $data['collects']);
    }
559333
private function request(RequestParams $params)
    {
        /*
         * Build Resource URI
         */
        $rm = $params->resourceMetadata;
        $base = $this->config['base_url'] . $this->config['api_path'] . "/";

        if (!empty($params->appId)) {
            $url = $base . 'General/Apps/' . $params->appId . '/callBackend';
        } else {
            $url = $base . $rm->product . '/' . $rm->resource;
        }

        if (!empty($params->id)) {
            $url .= '/' . $params->id;
        }

        if (!empty($params->action)) {
            $url .= '/' . $params->action;
        }

        if (!empty($params->actionArg)) {
            $url .= '/' . $params->actionArg;
        }

        $options = array_merge(['auth' => 'oauth'], $params->options);

        if (!array_key_exists(\GuzzleHttp\RequestOptions::HEADERS, $options)) {
            $options[\GuzzleHttp\RequestOptions::HEADERS] = [];
        }

        /*
         * Result filtering, sorting & searching
         */
        $p = [];
        if (!empty($params->searchParams->query)) {
            $q = $params->searchParams->query;

            if (!empty($q->count)) {
                $p['count'] = $q->count;
            }

            if (!empty($q->offset)) {
                $p['offset'] = $q->offset;
            }

            if (!empty($q->query)) {
                $p['q'] = $q->query;
            }

            if (!empty($q->fields)) {
                $p['fields'] = implode(',', $q->fields);
            }

            if (!empty($q->sortOrder)) {
                foreach ($q->sortOrder as $key => $value) {
                    $p['sort[' . $key . ']'] = $value;
                }
            }
        }

        if (!empty($params->searchParams->scrollId)) {
            $p['scroll_id'] = $params->searchParams->scrollId;
        }

        if (!empty($params->searchParams->scrollExpire)) {
            $p['scroll_expire'] = $params->searchParams->scrollExpire;
        }

        if (count($p) != 0) {
            $options[\GuzzleHttp\RequestOptions::QUERY] = $p;
        }

        /*
         * JSON Body
         */

        if (!empty($params->jsonData)) {
            $options[\GuzzleHttp\RequestOptions::BODY] = $params->jsonData;
            $options[\GuzzleHttp\RequestOptions::HEADERS]['Content-Type'] = 'application/json';
        }

        /*
         * Idempotence (avoid double execution of the same request)
         */
        if ($this->actionId !== null) {
            $options[\GuzzleHttp\RequestOptions::HEADERS]['X-Action'] = $this->actionId;
            $this->setActionId(null);
        }

        /*
         * Run request
         */
        try {
            $response = $this->httpClient->request($params->operation, $url, $options);
        } catch (Exception $e) {
            throw $this->mapError($e, 'Error sending API request.');
        }

        if ($response->getStatusCode() == 200) {
            return MapperUtil::mapResponse($response);
        }

        return false;
    }
1329121
protected function mergeShared(array $params)
    {
        $proxy = $this->getProxy();

        return array_merge($this->globals, $params, ['view' => $proxy, 'func' => [$this, 'func']]);
    }
679248
function listHookNamesOptions() {
    $data = $this->getHookDeclarations();

    $return = array();
    foreach ($data as $hook_name => $hook_info) {
      $return[$hook_name] = $hook_info['description'];
    }

    return $return;
  }
1134562
protected function sortHooks(array $hooks)
    {
        foreach ($hooks as $scopeName => &$scopeHooks) {
            foreach ($scopeHooks as $hookName => &$hookList) {
                usort($hookList, array($this, 'cmpHooks'));
            }
        }

        return $hooks;
    }
378946
public function all(array $params = array())
    {
        $endpoint = '/admin/blogs.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Blog::class, $response['blogs']);
    }
782128
public function getAll($params = [])
    {
        $result = $this->connection()->get($this->getEndpoint(), $params, true);

        return $this->collectionFromResult($result);
    }
712033
private function parseHooks(array $hooks)
    {
        $list = [];

        foreach ($hooks as $func) {
            if (isset($func['name'])) {
                $list[] = NamedJsFunction::createFromArray($func);

                continue;
            }

            $list[] = ErlangFunction::createFromArray($func);
        }

        return $list;
    }