Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Ads.php #101

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/VK/Actions/Ads.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,4 +637,48 @@ public function updateClients($access_token, array $params = []) {
public function updateTargetGroup($access_token, array $params = []) {
return $this->request->post('ads.updateTargetGroup', $access_token, $params);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws VKApiException
* @throws VKClientException
*/
public function getTargetPixels($access_token, array $params = []) {
return $this->request->post('ads.getTargetPixels', $access_token, $params);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws VKApiException
* @throws VKClientException
*/
public function createTargetPixel($access_token, array $params = []) {
return $this->request->post('ads.createTargetPixel', $access_token, $params);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws VKApiException
* @throws VKClientException
*/
public function deleteTargetPixel($access_token, array $params = []) {
return $this->request->post('ads.deleteTargetPixel', $access_token, $params);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws VKApiException
* @throws VKClientException
*/
public function updateTargetPixel($access_token, array $params = []) {
return $this->request->post('ads.updateTargetPixel', $access_token, $params);
}
}
106 changes: 106 additions & 0 deletions src/VK/Actions/LeadForms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?php

namespace VK\Actions;

use VK\Client\VKApiRequest;

class LeadForms
{
/**
* @var VKApiRequest
*/
private $request;

/**
* Groups constructor.
*
* @param VKApiRequest $request
*/
public function __construct(VKApiRequest $request)
{
$this->request = $request;
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws \VK\Exceptions\VKApiException
* @throws \VK\Exceptions\VKClientException
*/
public function create($access_token, array $params = [])
{
return $this->request->post('leadForms.create', $access_token, $params);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws \VK\Exceptions\VKApiException
* @throws \VK\Exceptions\VKClientException
*/
public function delete($access_token, array $params = [])
{
return $this->request->post('leadForms.delete', $access_token, $params);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws \VK\Exceptions\VKApiException
* @throws \VK\Exceptions\VKClientException
*/
public function get($access_token, array $params = [])
{
return $this->request->post('leadForms.get', $access_token, $params);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws \VK\Exceptions\VKApiException
* @throws \VK\Exceptions\VKClientException
*/
public function getLeads($access_token, array $params = [])
{
return $this->request->post('leadForms.getLeads', $access_token, $params);
}

/**
* @param $access_token
* @return array|mixed
* @throws \VK\Exceptions\VKApiException
* @throws \VK\Exceptions\VKClientException
*/
public function getUploadURL($access_token)
{
return $this->request->post('leadForms.getUploadURL', $access_token);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws \VK\Exceptions\VKApiException
* @throws \VK\Exceptions\VKClientException
*/
public function list($access_token, array $params = [])
{
return $this->request->post('leadForms.list', $access_token, $params);
}

/**
* @param $access_token
* @param array $params
* @return array|mixed
* @throws \VK\Exceptions\VKApiException
* @throws \VK\Exceptions\VKClientException
*/
public function update($access_token, array $params = [])
{
return $this->request->post('leadForms.update', $access_token, $params);
}
}
137 changes: 0 additions & 137 deletions src/VK/Actions/Leads.php

This file was deleted.

33 changes: 8 additions & 25 deletions src/VK/Client/VKApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use VK\Actions\Friends;
use VK\Actions\Gifts;
use VK\Actions\Groups;
use VK\Actions\Leads;
use VK\Actions\LeadForms;
use VK\Actions\Likes;
use VK\Actions\Market;
use VK\Actions\Messages;
Expand All @@ -24,7 +24,6 @@
use VK\Actions\Orders;
use VK\Actions\Pages;
use VK\Actions\Photos;
use VK\Actions\Places;
use VK\Actions\Polls;
use VK\Actions\Search;
use VK\Actions\Secure;
Expand Down Expand Up @@ -104,9 +103,9 @@ class VKApiClient {
private $groups;

/**
* @var Leads
* @var LeadForms
*/
private $leads;
private $leadForms;

/**
* @var Likes
Expand Down Expand Up @@ -153,11 +152,6 @@ class VKApiClient {
*/
private $photos;

/**
* @var Places
*/
private $places;

/**
* @var Polls
*/
Expand Down Expand Up @@ -361,14 +355,14 @@ public function groups(): Groups {
}

/**
* @return Leads
* @return LeadForms
*/
public function leads(): Leads {
if (!$this->leads) {
$this->leads = new Leads($this->request);
public function leadForms(): LeadForms {
if (!$this->leadForms) {
$this->leadForms = new LeadForms($this->request);
}

return $this->leads;
return $this->leadForms;
}

/**
Expand Down Expand Up @@ -470,17 +464,6 @@ public function photos(): Photos {
return $this->photos;
}

/**
* @return Places
*/
public function places(): Places {
if (!$this->places) {
$this->places = new Places($this->request);
}

return $this->places;
}

/**
* @return Polls
*/
Expand Down
Loading