Example #1
0
 /**
  * Constructor
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 function __construct($apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
     }
     $this->apiClient = $apiClient;
 }
 /**
  * Constructor
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 function __construct($apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('https://localhost');
     }
     $this->apiClient = $apiClient;
 }
 /**
  * Constructor
  *
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 public function __construct(\Swagger\Client\ApiClient $apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('http://example.com/rest/default');
     }
     $this->apiClient = $apiClient;
 }
 /**
  * Constructor
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 function __construct($apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('https://api.netatmo.net/api');
     }
     $this->apiClient = $apiClient;
 }
 /**
  * Constructor
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 function __construct($apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('https://www.callcontrol.com');
     }
     $this->apiClient = $apiClient;
 }
Example #6
0
 /**
  * Constructor
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 function __construct($apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('http://api.cloudboost.io/');
     }
     $this->apiClient = $apiClient;
 }
Example #7
0
 /**
  * Constructor
  *
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 public function __construct(\Swagger\Client\ApiClient $apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('https://petstore.swagger.io *_/ ' \\" =end -- \\r\\n \\n \\r/v2 *_/ ' \\" =end -- \\r\\n \\n \\r');
     }
     $this->apiClient = $apiClient;
 }
Example #8
0
 /**
  * Constructor
  *
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 public function __construct(\Swagger\Client\ApiClient $apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('https://amdimbh5tf.execute-api.us-east-1.amazonaws.com/v7');
     }
     $this->apiClient = $apiClient;
 }
Example #9
0
 /**
  * Constructor
  *
  * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
  */
 public function __construct(\Swagger\Client\ApiClient $apiClient = null)
 {
     if ($apiClient == null) {
         $apiClient = new ApiClient();
         $apiClient->getConfig()->setHost('https://virtserver.swaggerhub.com/kesh92/API_Doc_Demo/1.0.0');
     }
     $this->apiClient = $apiClient;
 }
 public function testApiClient()
 {
     // test selectHeaderAccept
     $api_client = new ApiClient();
     $this->assertSame('application/json', $api_client->selectHeaderAccept(array('application/xml', 'application/json')));
     $this->assertSame(null, $api_client->selectHeaderAccept(array()));
     $this->assertSame('application/yaml,application/xml', $api_client->selectHeaderAccept(array('application/yaml', 'application/xml')));
     // test selectHeaderContentType
     $this->assertSame('application/json', $api_client->selectHeaderContentType(array('application/xml', 'application/json')));
     $this->assertSame('application/json', $api_client->selectHeaderContentType(array()));
     $this->assertSame('application/yaml,application/xml', $api_client->selectHeaderContentType(array('application/yaml', 'application/xml')));
     // test addDefaultHeader and getDefaultHeader
     $api_client->getConfig()->addDefaultHeader('test1', 'value1');
     $api_client->getConfig()->addDefaultHeader('test2', 200);
     $defaultHeader = $api_client->getConfig()->getDefaultHeaders();
     $this->assertSame('value1', $defaultHeader['test1']);
     $this->assertSame(200, $defaultHeader['test2']);
     // test deleteDefaultHeader
     $api_client->getConfig()->deleteDefaultHeader('test2');
     $defaultHeader = $api_client->getConfig()->getDefaultHeaders();
     $this->assertFalse(isset($defaultHeader['test2']));
     $pet_api2 = new Api\PetApi();
     $config3 = new Configuration();
     $apiClient3 = new ApiClient($config3);
     $apiClient3->getConfig()->setUserAgent('api client 3');
     $config4 = new Configuration();
     $apiClient4 = new ApiClient($config4);
     $apiClient4->getConfig()->setUserAgent('api client 4');
     $pet_api3 = new Api\PetApi($apiClient3);
     // 2 different api clients are not the same
     $this->assertNotEquals($apiClient3, $apiClient4);
     // customied pet api not using the old pet api's api client
     $this->assertNotEquals($pet_api2->getApiClient(), $pet_api3->getApiClient());
     // test access token
     $api_client->getConfig()->setAccessToken("testing_only");
     $this->assertSame('testing_only', $api_client->getConfig()->getAccessToken());
 }