-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from ingrammicro/v16-dev
V16 dev
- Loading branch information
Showing
32 changed files
with
344 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Ingram Micro Cloud Blue Connect SDK. | ||
* | ||
* @copyright (c) 2019. Ingram Micro. All Rights Reserved. | ||
*/ | ||
|
||
namespace Connect; | ||
|
||
/** | ||
* Class Conversation | ||
* @package Connect | ||
*/ | ||
class Conversation extends Model | ||
{ | ||
public $id; | ||
public $instance_id; | ||
public $created; | ||
public $topic; | ||
|
||
/** | ||
* @var RequestsProcessor | ||
* @noparse | ||
*/ | ||
public $requestProcessor; | ||
|
||
/** | ||
* @var ConversationMessage[] | ||
*/ | ||
public $messages; | ||
|
||
public function setMessages($messages) | ||
{ | ||
$this->messages = Model::modelize('conversationMessages', $messages); | ||
} | ||
|
||
/** | ||
* @param $message | ||
* @return array|Model | ||
*/ | ||
public function addMessage($message) | ||
{ | ||
if (isset($this->id)) { | ||
$request = $this->requestProcessor->sendRequest( | ||
'POST', | ||
"/conversations/" . $this->id . "/messages", | ||
json_encode(array("text" => $message)) | ||
); | ||
return Model::modelize('conversationMessage', json_decode($request)); | ||
} | ||
} | ||
} |
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,27 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Ingram Micro Cloud Blue Connect SDK. | ||
* | ||
* @copyright (c) 2019. Ingram Micro. All Rights Reserved. | ||
*/ | ||
|
||
namespace Connect; | ||
|
||
/** | ||
* Class ConversationMessage | ||
* @package Connect | ||
*/ | ||
class ConversationMessage extends Model | ||
{ | ||
public $id; | ||
public $conversation; | ||
public $created; | ||
public $text; | ||
public $type; | ||
|
||
/** | ||
* @var Owner | ||
*/ | ||
public $creator; | ||
} |
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 |
---|---|---|
|
@@ -146,4 +146,4 @@ public function sendRequest($verb, $path, $body = null) | |
|
||
return $response->getBody()->getContents(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.