Skip to content

Commit 14fa56e

Browse files
author
kevin
committed
release(0.2.62): Release php SDK
1 parent 4015cec commit 14fa56e

11 files changed

+366
-9
lines changed

docs/Model/Article.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ Name | Type | Description | Notes
3131
**continent** | **string** | | [optional]
3232
**assets** | [**\AskNews\Model\Assets**](Assets.md) | | [optional]
3333
**social_embeds** | **string[]** | | [optional]
34+
**bias** | **string** | | [optional]
3435

3536
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/SearchResponseDictItem.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Name | Type | Description | Notes
3131
**continent** | **string** | | [optional]
3232
**assets** | [**\AskNews\Model\Assets**](Assets.md) | | [optional]
3333
**social_embeds** | **string[]** | | [optional]
34+
**bias** | **string** | | [optional]
3435
**as_string_key** | **string** | |
3536

3637
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/SearchResponseDictItem1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Name | Type | Description | Notes
3131
**continent** | **string** | | [optional]
3232
**assets** | [**\AskNews\Model\Assets1**](Assets1.md) | | [optional]
3333
**social_embeds** | **string[]** | | [optional]
34+
**bias** | **string** | | [optional]
3435
**as_string_key** | **string** | |
3536

3637
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

lib/Api/DistributionApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,8 +3478,8 @@ public function topNArticlesForDomainRequest($domain, $limit = 10, $start_date =
34783478
);
34793479
}
34803480

3481-
if ($limit !== null && $limit > 100) {
3482-
throw new \InvalidArgumentException('invalid value for "$limit" when calling DistributionApi.topNArticlesForDomain, must be smaller than or equal to 100.');
3481+
if ($limit !== null && $limit > 1000) {
3482+
throw new \InvalidArgumentException('invalid value for "$limit" when calling DistributionApi.topNArticlesForDomain, must be smaller than or equal to 1000.');
34833483
}
34843484
if ($limit !== null && $limit < 1) {
34853485
throw new \InvalidArgumentException('invalid value for "$limit" when calling DistributionApi.topNArticlesForDomain, must be bigger than or equal to 1.');

lib/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Configuration
8585
*
8686
* @var string
8787
*/
88-
protected $userAgent = 'asknews-sdk-php-0.2.61';
88+
protected $userAgent = 'asknews-sdk-php-0.2.62';
8989

9090
/**
9191
* Debug switch (default set to false)

lib/Model/Article.php

Lines changed: 115 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class Article implements ModelInterface, ArrayAccess, \JsonSerializable
8383
'geo_coordinates' => 'array<string,\AskNews\Model\GeoCoordinate>',
8484
'continent' => 'string',
8585
'assets' => '\AskNews\Model\Assets',
86-
'social_embeds' => 'string[]'
86+
'social_embeds' => 'string[]',
87+
'bias' => 'string'
8788
];
8889

8990
/**
@@ -120,7 +121,8 @@ class Article implements ModelInterface, ArrayAccess, \JsonSerializable
120121
'geo_coordinates' => null,
121122
'continent' => null,
122123
'assets' => null,
123-
'social_embeds' => null
124+
'social_embeds' => null,
125+
'bias' => null
124126
];
125127

126128
/**
@@ -155,7 +157,8 @@ class Article implements ModelInterface, ArrayAccess, \JsonSerializable
155157
'geo_coordinates' => true,
156158
'continent' => true,
157159
'assets' => true,
158-
'social_embeds' => true
160+
'social_embeds' => true,
161+
'bias' => true
159162
];
160163

161164
/**
@@ -270,7 +273,8 @@ public function isNullableSetToNull(string $property): bool
270273
'geo_coordinates' => 'geo_coordinates',
271274
'continent' => 'continent',
272275
'assets' => 'assets',
273-
'social_embeds' => 'social_embeds'
276+
'social_embeds' => 'social_embeds',
277+
'bias' => 'bias'
274278
];
275279

276280
/**
@@ -305,7 +309,8 @@ public function isNullableSetToNull(string $property): bool
305309
'geo_coordinates' => 'setGeoCoordinates',
306310
'continent' => 'setContinent',
307311
'assets' => 'setAssets',
308-
'social_embeds' => 'setSocialEmbeds'
312+
'social_embeds' => 'setSocialEmbeds',
313+
'bias' => 'setBias'
309314
];
310315

311316
/**
@@ -340,7 +345,8 @@ public function isNullableSetToNull(string $property): bool
340345
'geo_coordinates' => 'getGeoCoordinates',
341346
'continent' => 'getContinent',
342347
'assets' => 'getAssets',
343-
'social_embeds' => 'getSocialEmbeds'
348+
'social_embeds' => 'getSocialEmbeds',
349+
'bias' => 'getBias'
344350
];
345351

346352
/**
@@ -395,6 +401,25 @@ public function getModelName()
395401
public const CONTINENT_NORTH_AMERICA = 'North America';
396402
public const CONTINENT_SOUTH_AMERICA = 'South America';
397403
public const CONTINENT_OCEANIA = 'Oceania';
404+
public const BIAS_POLITICAL = 'Political';
405+
public const BIAS_GENDER = 'Gender';
406+
public const BIAS_CULTURAL = 'Cultural';
407+
public const BIAS_AGE = 'Age';
408+
public const BIAS_RELIGIOUS = 'Religious';
409+
public const BIAS_STATEMENT = 'Statement';
410+
public const BIAS_ILLOGICAL_CLAIMS = 'Illogical Claims';
411+
public const BIAS_SLANT = 'Slant';
412+
public const BIAS_SOURCE_SELECTION = 'Source Selection';
413+
public const BIAS_OMISSION_OF_SOURCE_ATTRIBUTION = 'Omission of Source Attribution';
414+
public const BIAS_SPIN = 'Spin';
415+
public const BIAS_SENSATIONALISM = 'Sensationalism';
416+
public const BIAS_NEGATIVITY = 'Negativity';
417+
public const BIAS_SUBJECTIVE_ADJECTIVES = 'Subjective Adjectives';
418+
public const BIAS_AD_HOMINEM = 'Ad Hominem';
419+
public const BIAS_MIND_READING = 'Mind Reading';
420+
public const BIAS_OPINION_AS_FACT = 'Opinion-as-Fact';
421+
public const BIAS_NONE = 'None';
422+
public const BIAS_UNKNOWN = 'Unknown';
398423

399424
/**
400425
* Gets allowable values of the enum
@@ -429,6 +454,36 @@ public function getContinentAllowableValues()
429454
];
430455
}
431456

457+
/**
458+
* Gets allowable values of the enum
459+
*
460+
* @return string[]
461+
*/
462+
public function getBiasAllowableValues()
463+
{
464+
return [
465+
self::BIAS_POLITICAL,
466+
self::BIAS_GENDER,
467+
self::BIAS_CULTURAL,
468+
self::BIAS_AGE,
469+
self::BIAS_RELIGIOUS,
470+
self::BIAS_STATEMENT,
471+
self::BIAS_ILLOGICAL_CLAIMS,
472+
self::BIAS_SLANT,
473+
self::BIAS_SOURCE_SELECTION,
474+
self::BIAS_OMISSION_OF_SOURCE_ATTRIBUTION,
475+
self::BIAS_SPIN,
476+
self::BIAS_SENSATIONALISM,
477+
self::BIAS_NEGATIVITY,
478+
self::BIAS_SUBJECTIVE_ADJECTIVES,
479+
self::BIAS_AD_HOMINEM,
480+
self::BIAS_MIND_READING,
481+
self::BIAS_OPINION_AS_FACT,
482+
self::BIAS_NONE,
483+
self::BIAS_UNKNOWN,
484+
];
485+
}
486+
432487
/**
433488
* Associative array for storing property values
434489
*
@@ -471,6 +526,7 @@ public function __construct(?array $data = null)
471526
$this->setIfExists('continent', $data ?? [], null);
472527
$this->setIfExists('assets', $data ?? [], null);
473528
$this->setIfExists('social_embeds', $data ?? [], null);
529+
$this->setIfExists('bias', $data ?? [], null);
474530
}
475531

476532
/**
@@ -577,6 +633,15 @@ public function listInvalidProperties()
577633
);
578634
}
579635

636+
$allowedValues = $this->getBiasAllowableValues();
637+
if (!is_null($this->container['bias']) && !in_array($this->container['bias'], $allowedValues, true)) {
638+
$invalidProperties[] = sprintf(
639+
"invalid value '%s' for 'bias', must be one of '%s'",
640+
$this->container['bias'],
641+
implode("', '", $allowedValues)
642+
);
643+
}
644+
580645
return $invalidProperties;
581646
}
582647

@@ -1396,6 +1461,50 @@ public function setSocialEmbeds($social_embeds)
13961461

13971462
return $this;
13981463
}
1464+
1465+
/**
1466+
* Gets bias
1467+
*
1468+
* @return string|null
1469+
*/
1470+
public function getBias()
1471+
{
1472+
return $this->container['bias'];
1473+
}
1474+
1475+
/**
1476+
* Sets bias
1477+
*
1478+
* @param string|null $bias bias
1479+
*
1480+
* @return self
1481+
*/
1482+
public function setBias($bias)
1483+
{
1484+
if (is_null($bias)) {
1485+
array_push($this->openAPINullablesSetToNull, 'bias');
1486+
} else {
1487+
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
1488+
$index = array_search('bias', $nullablesSetToNull);
1489+
if ($index !== FALSE) {
1490+
unset($nullablesSetToNull[$index]);
1491+
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
1492+
}
1493+
}
1494+
$allowedValues = $this->getBiasAllowableValues();
1495+
if (!is_null($bias) && !in_array($bias, $allowedValues, true)) {
1496+
throw new \InvalidArgumentException(
1497+
sprintf(
1498+
"Invalid value '%s' for 'bias', must be one of '%s'",
1499+
$bias,
1500+
implode("', '", $allowedValues)
1501+
)
1502+
);
1503+
}
1504+
$this->container['bias'] = $bias;
1505+
1506+
return $this;
1507+
}
13991508
/**
14001509
* Returns true if offset exists. False otherwise.
14011510
*

0 commit comments

Comments
 (0)