-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inspection API calls and functional tests
- Loading branch information
1 parent
2b88d2d
commit 6544548
Showing
11 changed files
with
459 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Automile\Sdk\Models\Vehicle; | ||
|
||
use Automile\Sdk\Models\ModelAbstract; | ||
|
||
/** | ||
* InspectionExport Vehicle Model | ||
*/ | ||
class InspectionExport extends ModelAbstract | ||
{ | ||
|
||
protected $_allowedProperties = [ | ||
'ToEmail', | ||
'ISO639LanguageCode' | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace Automile\Sdk\Types; | ||
|
||
/** | ||
* Attachment Type | ||
*/ | ||
class AttachmentType implements Type | ||
{ | ||
|
||
const IMAGE = 0; | ||
const PDF = 1; | ||
const DOCX = 2; | ||
const EXCEL = 3; | ||
|
||
/** | ||
* @param mixed $value | ||
* @return bool | ||
*/ | ||
public static function isValid($value) | ||
{ | ||
return in_array($value, rante(0, 3)); | ||
} | ||
|
||
/** | ||
* determine attachment type by file extension | ||
* @param string $filename | ||
* @return int | ||
*/ | ||
public static function getByFilename($filename) | ||
{ | ||
$ext = pathinfo($filename, PATHINFO_EXTENSION); | ||
|
||
switch ($ext) | ||
{ | ||
case 'jpg': | ||
case 'jpeg': | ||
case 'png': | ||
case 'gif': | ||
case 'tiff': | ||
case 'bmp': | ||
return self::IMAGE; | ||
|
||
case 'pdf': | ||
return self::PDF; | ||
|
||
case 'xls': | ||
case 'xlsx': | ||
return self::EXCEL; | ||
|
||
case 'docx': | ||
return self::DOCX; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Automile\Sdk\Types; | ||
|
||
/** | ||
* VehicleDefectStatus Type | ||
*/ | ||
class VehicleDefectStatusType implements Type | ||
{ | ||
|
||
const NOT_RESOLVED = 0; | ||
const RESOLVED = 1; | ||
|
||
/** | ||
* @param mixed $value | ||
* @return bool | ||
*/ | ||
public static function isValid($value) | ||
{ | ||
return in_array($value, range(0, 1)); | ||
} | ||
|
||
} |
Oops, something went wrong.