Skip to content

Commit

Permalink
Disabled media url encoding, mfa schema update (#16)
Browse files Browse the repository at this point in the history
* New deploy

* Update APIController.php

* Update APIController.php

Co-authored-by: DX-Bandwidth <[email protected]>
  • Loading branch information
jmulford-bw and DX-Bandwidth authored Jan 11, 2021
1 parent 1f88cd2 commit 23cbc8b
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 54 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ License:
The MIT License (MIT)
http://opensource.org/licenses/MIT

Copyright (c) 2014 - 2016 APIMATIC Limited
Copyright (c) 2014 - 2020 APIMATIC Limited

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BaseController
* User-agent to be sent with API calls
* @var string
*/
const USER_AGENT = 'php-sdk-refs/tags/phpold2.13.3';
const USER_AGENT = 'php-sdk';

/**
* HttpCallBack instance associated with this controller
Expand Down
10 changes: 6 additions & 4 deletions src/Messaging/Controllers/APIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,10 @@ public function uploadMedia(

//process optional query parameters
$_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (
'userId' => $userId,
'mediaId' => $mediaId,
));
'userId' => $userId,
'mediaId' => $mediaId,
), false
);

//validate and preprocess url
$_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MESSAGINGDEFAULT) . $_queryBuilder);
Expand Down Expand Up @@ -327,7 +328,8 @@ public function deleteMedia(
$_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (
'userId' => $userId,
'mediaId' => $mediaId,
));
), false
);

//validate and preprocess url
$_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MESSAGINGDEFAULT) . $_queryBuilder);
Expand Down
28 changes: 5 additions & 23 deletions src/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ class TwoFactorVerifyRequestSchema implements \JsonSerializable
*/
public $to;

/**
* The application phone number, the sender of the 2fa code.
* @required
* @var string $from public property
*/
public $from;

/**
* The application unique ID, obtained from Bandwidth.
* @required
Expand All @@ -40,13 +33,6 @@ class TwoFactorVerifyRequestSchema implements \JsonSerializable
*/
public $scope;

/**
* The number of digits for your 2fa code. The valid number ranges from 2 to 8, inclusively.
* @required
* @var double $digits public property
*/
public $digits;

/**
* The time period, in minutes, to validate the 2fa code. By setting this to 3 minutes, it will mean
* any code generated within the last 3 minutes are still valid. The valid range for expiration time
Expand All @@ -68,14 +54,12 @@ class TwoFactorVerifyRequestSchema implements \JsonSerializable
*/
public function __construct()
{
if (7 == func_num_args()) {
if (5 == func_num_args()) {
$this->to = func_get_arg(0);
$this->from = func_get_arg(1);
$this->applicationId = func_get_arg(2);
$this->scope = func_get_arg(3);
$this->digits = func_get_arg(4);
$this->expirationTimeInMinutes = func_get_arg(5);
$this->code = func_get_arg(6);
$this->applicationId = func_get_arg(1);
$this->scope = func_get_arg(2);
$this->expirationTimeInMinutes = func_get_arg(3);
$this->code = func_get_arg(4);
}
}

Expand All @@ -86,10 +70,8 @@ public function jsonSerialize()
{
$json = array();
$json['to'] = $this->to;
$json['from'] = $this->from;
$json['applicationId'] = $this->applicationId;
$json['scope'] = $this->scope;
$json['digits'] = $this->digits;
$json['expirationTimeInMinutes'] = $this->expirationTimeInMinutes;
$json['code'] = $this->code;

Expand Down
6 changes: 3 additions & 3 deletions src/Voice/Controllers/APIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1650,9 +1650,9 @@ public function getConferenceById(
/**
* Modify the conference state
*
* @param string $accountId TODO: type description here
* @param string $conferenceId TODO: type description here
* @param Models\CallEngineModifyConferenceRequest $body (optional) TODO: type description here
* @param string $accountId TODO: type description here
* @param string $conferenceId TODO: type description here
* @param Models\ApiModifyConferenceRequest $body (optional) TODO: type description here
* @return ApiResponse response from the API call
* @throws APIException Thrown if API call fails
*/
Expand Down
46 changes: 28 additions & 18 deletions src/Voice/Models/ApiCreateCallRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ class ApiCreateCallRequest implements \JsonSerializable
public $from;

/**
* Format is E164
* Format is E164 or SIP URI
* @required
* @var string $to public property
*/
public $to;

/**
* When calling a SIP URI, this will be sent as the 'User-To-User' header within the initial INVITE. An
* 'encoding' parameter must be specified as described in https://tools.ietf.org/html/rfc7433. This
* header cannot exceed 256 characters, including the encoding parameter.
* @var string|null $uui public property
*/
public $uui;

/**
* @todo Write general description for this property
* @var double|null $callTimeout public property
Expand Down Expand Up @@ -129,25 +137,26 @@ class ApiCreateCallRequest implements \JsonSerializable
*/
public function __construct()
{
if (18 == func_num_args()) {
if (19 == func_num_args()) {
$this->from = func_get_arg(0);
$this->to = func_get_arg(1);
$this->callTimeout = func_get_arg(2);
$this->callbackTimeout = func_get_arg(3);
$this->answerUrl = func_get_arg(4);
$this->answerFallbackUrl = func_get_arg(5);
$this->username = func_get_arg(6);
$this->password = func_get_arg(7);
$this->fallbackUsername = func_get_arg(8);
$this->fallbackPassword = func_get_arg(9);
$this->answerMethod = func_get_arg(10);
$this->answerFallbackMethod = func_get_arg(11);
$this->disconnectUrl = func_get_arg(12);
$this->disconnectMethod = func_get_arg(13);
$this->tag = func_get_arg(14);
$this->applicationId = func_get_arg(15);
$this->obfuscatedTo = func_get_arg(16);
$this->obfuscatedFrom = func_get_arg(17);
$this->uui = func_get_arg(2);
$this->callTimeout = func_get_arg(3);
$this->callbackTimeout = func_get_arg(4);
$this->answerUrl = func_get_arg(5);
$this->answerFallbackUrl = func_get_arg(6);
$this->username = func_get_arg(7);
$this->password = func_get_arg(8);
$this->fallbackUsername = func_get_arg(9);
$this->fallbackPassword = func_get_arg(10);
$this->answerMethod = func_get_arg(11);
$this->answerFallbackMethod = func_get_arg(12);
$this->disconnectUrl = func_get_arg(13);
$this->disconnectMethod = func_get_arg(14);
$this->tag = func_get_arg(15);
$this->applicationId = func_get_arg(16);
$this->obfuscatedTo = func_get_arg(17);
$this->obfuscatedFrom = func_get_arg(18);
}
}

Expand All @@ -159,6 +168,7 @@ public function jsonSerialize()
$json = array();
$json['from'] = $this->from;
$json['to'] = $this->to;
$json['uui'] = $this->uui;
$json['callTimeout'] = $this->callTimeout;
$json['callbackTimeout'] = $this->callbackTimeout;
$json['answerUrl'] = $this->answerUrl;
Expand Down
105 changes: 105 additions & 0 deletions src/Voice/Models/ApiModifyConferenceRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php
/*
* BandwidthLib
*
* This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
*/

namespace BandwidthLib\Voice\Models;

/**
* @todo Write general description for this model
*/
class ApiModifyConferenceRequest implements \JsonSerializable
{
/**
* @todo Write general description for this property
* @var string|null $status public property
*/
public $status;

/**
* @todo Write general description for this property
* @var string|null $redirectUrl public property
*/
public $redirectUrl;

/**
* @todo Write general description for this property
* @var string|null $redirectFallbackUrl public property
*/
public $redirectFallbackUrl;

/**
* @todo Write general description for this property
* @var string|null $redirectMethod public property
*/
public $redirectMethod;

/**
* @todo Write general description for this property
* @var string|null $redirectFallbackMethod public property
*/
public $redirectFallbackMethod;

/**
* @todo Write general description for this property
* @var string|null $username public property
*/
public $username;

/**
* @todo Write general description for this property
* @var string|null $password public property
*/
public $password;

/**
* @todo Write general description for this property
* @var string|null $fallbackUsername public property
*/
public $fallbackUsername;

/**
* @todo Write general description for this property
* @var string|null $fallbackPassword public property
*/
public $fallbackPassword;

/**
* Constructor to set initial or default values of member properties
*/
public function __construct()
{
if (9 == func_num_args()) {
$this->status = func_get_arg(0);
$this->redirectUrl = func_get_arg(1);
$this->redirectFallbackUrl = func_get_arg(2);
$this->redirectMethod = func_get_arg(3);
$this->redirectFallbackMethod = func_get_arg(4);
$this->username = func_get_arg(5);
$this->password = func_get_arg(6);
$this->fallbackUsername = func_get_arg(7);
$this->fallbackPassword = func_get_arg(8);
}
}

/**
* Encode this object to JSON
*/
public function jsonSerialize()
{
$json = array();
$json['status'] = $this->status;
$json['redirectUrl'] = $this->redirectUrl;
$json['redirectFallbackUrl'] = $this->redirectFallbackUrl;
$json['redirectMethod'] = $this->redirectMethod;
$json['redirectFallbackMethod'] = $this->redirectFallbackMethod;
$json['username'] = $this->username;
$json['password'] = $this->password;
$json['fallbackUsername'] = $this->fallbackUsername;
$json['fallbackPassword'] = $this->fallbackPassword;

return array_filter($json);
}
}
3 changes: 2 additions & 1 deletion src/Voice/Models/ModifyCallRecordingState.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class ModifyCallRecordingState implements \JsonSerializable
{
/**
* @todo Write general description for this property
* @var string|null $state public property
* @required
* @var string $state public property
*/
public $state;

Expand Down
6 changes: 3 additions & 3 deletions src/Voice/Models/StateEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class StateEnum
/**
* TODO: Write general description for this element
*/
const DISCONNECTED = "disconnected";
const DISCONNECTED = "DISCONNECTED";

/**
* TODO: Write general description for this element
*/
const ANSWERED = "answered";
const ANSWERED = "ANSWERED";

/**
* TODO: Write general description for this element
*/
const INITIATED = "initiated";
const INITIATED = "INITIATED";
}

0 comments on commit 23cbc8b

Please sign in to comment.