Skip to content

Commit 42e2fcc

Browse files
authored
Merge pull request #210 from BingAds/v13.0.24.1
v13.0.24.1
2 parents b03b821 + 3ed8448 commit 42e2fcc

File tree

78 files changed

+1637
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1637
-6
lines changed

src/Auth/OAuthAuthorization.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ abstract class OAuthAuthorization extends Authentication
4343
*/
4444
public $Tenant = "common";
4545

46+
/**
47+
* Determines if use msa production accounts on sandbox.
48+
* @var bool
49+
*/
50+
public $UseMsaProd = true;
51+
4652
public function __construct() {}
4753

4854
/**
@@ -97,7 +103,8 @@ public function withOAuthTokens($oauthTokens) {
97103
*/
98104
public function withEnvironment($environment) {
99105
$this->Environment = $environment;
100-
$this->RedirectUri=UriOAuthService::GetRedirectUrl($environment, $this->OAuthScope);
106+
$this->OAuthScope = ($environment == ApiEnvironment::Sandbox && $this->UseMsaProd) ? OAuthScope::MSA_PROD : $this->OAuthScope;
107+
$this->RedirectUri=UriOAuthService::GetRedirectUrl($environment, ($environment == ApiEnvironment::Sandbox && $this->UseMsaProd) ? OAuthScope::MSA_PROD : $this->OAuthScope);
101108
return $this;
102109
}
103110

@@ -108,8 +115,8 @@ public function withEnvironment($environment) {
108115
* @return OAuthAuthorization this builder
109116
*/
110117
public function withOAuthScope($oauthScope) {
111-
$this->OAuthScope = $oauthScope;
112-
$this->RedirectUri=UriOAuthService::GetRedirectUrl($this->Environment, $oauthScope);
118+
$this->OAuthScope = ($this->Environment == ApiEnvironment::Sandbox && $this->UseMsaProd) ? OAuthScope::MSA_PROD : $oauthScope;
119+
$this->RedirectUri=UriOAuthService::GetRedirectUrl($this->Environment, ($this->Environment == ApiEnvironment::Sandbox && $this->UseMsaProd) ? OAuthScope::MSA_PROD : $oauthScope);
113120
return $this;
114121
}
115122

@@ -124,6 +131,17 @@ public function withTenant($tenant) {
124131
return $this;
125132
}
126133

134+
/**
135+
* Includes the UseMsaProd flag.
136+
*
137+
* @param bool $useMsaProd
138+
* @return OAuthAuthorization this builder
139+
*/
140+
public function withUseMsaProd($useMsaProd) {
141+
$this->UseMsaProd = $useMsaProd;
142+
return $this;
143+
}
144+
127145
/**
128146
* Implementations of this abstract method will get the Microsoft Account authorization endpoint
129147
* where the user should be navigated to give their consent.

src/Auth/OAuthEndpointType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ final class OAuthEndpointType
2626
* Sandbox for Live Connect
2727
*/
2828
const Sandbox = 'Sandbox';
29+
30+
/**
31+
* Sandbox for Msa Production
32+
*/
33+
const MsaProd = 'MsaProd';
2934
}

src/Auth/OAuthScope.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ final class OAuthScope
2121
* Represents ads.manage OAuth scope
2222
*/
2323
const ADS_MANAGE = 'ads.manage';
24+
25+
/**
26+
* Represents msa.prod OAuth scope
27+
*/
28+
const MSA_PROD = 'msa.prod';
2429
}

src/Auth/ServiceClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private function RefreshServiceProxy()
242242
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
243243
// Disable keep_alive to avoid 'Process open FD table is full'
244244
'keep_alive' => FALSE,
245-
'user_agent' => 'BingAdsSDKPHP ' . '13.0.24 ' . PHP_VERSION,
245+
'user_agent' => 'BingAdsSDKPHP ' . '13.0.24.1 ' . PHP_VERSION,
246246
'cache_wsdl' => 'WSDL_CACHE_NONE',
247247

248248
/**

src/Auth/UriOAuthService.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class UriOAuthService extends IOAuthService
3232
'AuthorizationEndpointUrl' => 'https://login.windows-ppe.net/consumers/oauth2/v2.0/authorize?scope=https://api.ads.microsoft.com/msads.manage+offline_access&prompt=login',
3333
'Scope' => 'https://api.ads.microsoft.com/msads.manage offline_access'
3434
),
35+
'MsaProd' => array(
36+
'RedirectUrl' => 'https://login.microsoftonline.com/common/oauth2/nativeclient',
37+
'OAuthTokenUrl' => 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
38+
'AuthorizationEndpointUrl' => 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?scope=https://si.ads.microsoft.com/msads.manage+offline_access&prompt=login',
39+
'Scope' => 'https://si.ads.microsoft.com/msads.manage offline_access'
40+
),
3541
);
3642

3743
private $httpService;
@@ -185,9 +191,16 @@ private static function GetOAuthEndpointType($environment, $oauthScope)
185191
$endpointType = OAuthEndpointType::ProductionMSIdentityV2_MSScope;
186192
}
187193
}
188-
else
194+
else if ($environment == ApiEnvironment::Sandbox)
189195
{
190-
$endpointType = OAuthEndpointType::Sandbox;
196+
if ($oauthScope == OAuthScope::MSA_PROD)
197+
{
198+
$endpointType = OAuthEndpointType::MsaProd;
199+
}
200+
else
201+
{
202+
$endpointType = OAuthEndpointType::Sandbox;
203+
}
191204
}
192205
return $endpointType;
193206
}

src/V13/Bulk/DownloadEntity.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,15 @@ final class DownloadEntity
578578

579579
/** Reserved. */
580580
const CampaignAccountPlacementExclusionListAssociation = 'CampaignAccountPlacementExclusionListAssociation';
581+
582+
/** Reserved. */
583+
const AccountPlacementInclusionList = 'AccountPlacementInclusionList';
584+
585+
/** Reserved. */
586+
const AccountPlacementInclusionListItem = 'AccountPlacementInclusionListItem';
587+
588+
/** Reserved. */
589+
const CampaignAccountPlacementInclusionListAssociation = 'CampaignAccountPlacementInclusionListAssociation';
581590
}
582591

583592
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Microsoft\BingAds\V13\CampaignManagement;
4+
5+
{
6+
/**
7+
* Reserved.
8+
* @link https:/learn.microsoft.com/advertising/campaign-management-service/adrecommendationadditionalfield?view=bingads-13 AdRecommendationAdditionalField Value Set
9+
*
10+
* @used-by CreateAssetGroupRecommendationRequest
11+
* @used-by CreateResponsiveAdRecommendationRequest
12+
* @used-by RefineAssetGroupRecommendationRequest
13+
* @used-by RefineResponsiveAdRecommendationRequest
14+
*/
15+
final class AdRecommendationAdditionalField
16+
{
17+
/** Reserved. */
18+
const ImageSuggestionMetadata = 'ImageSuggestionMetadata';
19+
20+
/** Reserved. */
21+
const MediaRefineResults = 'MediaRefineResults';
22+
23+
/** Reserved. */
24+
const PromptBrandWarning = 'PromptBrandWarning';
25+
}
26+
27+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Microsoft\BingAds\V13\CampaignManagement;
4+
5+
{
6+
/**
7+
* Reserved.
8+
* @link https:/learn.microsoft.com/advertising/campaign-management-service/adrecommendationcustomizedproperty?view=bingads-13 AdRecommendationCustomizedProperty Data Object
9+
*
10+
* @used-by AdRecommendationImageSuggestionMetadata
11+
*/
12+
final class AdRecommendationCustomizedProperty
13+
{
14+
/**
15+
* Reserved.
16+
* @var string
17+
*/
18+
public $AssetTypeName;
19+
20+
/**
21+
* Reserved.
22+
* @var string
23+
*/
24+
public $PropertyName;
25+
26+
/**
27+
* Reserved.
28+
* @var string
29+
*/
30+
public $PropertyValue;
31+
}
32+
33+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
namespace Microsoft\BingAds\V13\CampaignManagement;
4+
5+
{
6+
/**
7+
* Reserved.
8+
* @link https:/learn.microsoft.com/advertising/campaign-management-service/adrecommendationimageassetproperty?view=bingads-13 AdRecommendationImageAssetProperty Data Object
9+
*
10+
* @uses AdRecommendationImageField
11+
* @used-by AdRecommendationImageSuggestionMetadata
12+
*/
13+
final class AdRecommendationImageAssetProperty
14+
{
15+
/**
16+
* Reserved.
17+
* @var integer
18+
*/
19+
public $CropHeight;
20+
21+
/**
22+
* Reserved.
23+
* @var integer
24+
*/
25+
public $CropWidth;
26+
27+
/**
28+
* Reserved.
29+
* @var integer
30+
*/
31+
public $CropX;
32+
33+
/**
34+
* Reserved.
35+
* @var integer
36+
*/
37+
public $CropY;
38+
39+
/**
40+
* Reserved.
41+
* @var AdRecommendationImageField
42+
*/
43+
public $ImageField;
44+
45+
/**
46+
* Reserved.
47+
* @var string
48+
*/
49+
public $ImageUrl;
50+
}
51+
52+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Microsoft\BingAds\V13\CampaignManagement;
4+
5+
{
6+
/**
7+
* Reserved.
8+
* @link https:/learn.microsoft.com/advertising/campaign-management-service/adrecommendationimagefield?view=bingads-13 AdRecommendationImageField Value Set
9+
*
10+
* @used-by AdRecommendationImageAssetProperty
11+
*/
12+
final class AdRecommendationImageField
13+
{
14+
/** Reserved. */
15+
const Image = 'Image';
16+
17+
/** Reserved. */
18+
const Logo = 'Logo';
19+
}
20+
21+
}

0 commit comments

Comments
 (0)