Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd22a391

Browse files
committed
[Notifier] Add options to Microsoft Teams notifier
1 parent02704e9 commitd22a391

File tree

37 files changed

+2003
-3
lines changed

37 files changed

+2003
-3
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\Notifier\Bridge\MicrosoftTeams\Action;
13+
14+
useSymfony\Component\Notifier\Bridge\MicrosoftTeams\Input\InputInterface;
15+
16+
/**
17+
* @author Edouard Lescot <edouard.lescot@gmail.com>
18+
* @author Oskar Stark <oskarstark@googlemail.com>
19+
*
20+
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#actioncard-action
21+
*/
22+
class ActionCardActionimplements ActionInterface
23+
{
24+
protected$options = [];
25+
26+
publicfunctionname(string$name):self
27+
{
28+
$this->options['name'] =$name;
29+
30+
return$this;
31+
}
32+
33+
publicfunctioninput(InputInterface$inputAction):self
34+
{
35+
$this->options['inputs'][] =$inputAction->toArray();
36+
37+
return$this;
38+
}
39+
40+
publicfunctionaction(ActionCardCompatibleActionInterface$action):self
41+
{
42+
$this->options['actions'][] =$action->toArray();
43+
44+
return$this;
45+
}
46+
47+
publicfunctiontoArray():array
48+
{
49+
$this->options['@type'] ='ActionCard';
50+
51+
return$this->options;
52+
}
53+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\Notifier\Bridge\MicrosoftTeams\Action;
13+
14+
/**
15+
* An Action which can be used inside an ActionCard.
16+
*
17+
* @author Oskar Stark <oskarstark@googlemail.com>
18+
*/
19+
interface ActionCardCompatibleActionInterfaceextends ActionInterface
20+
{
21+
publicfunctiontoArray():array;
22+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\Notifier\Bridge\MicrosoftTeams\Action;
13+
14+
/**
15+
* @author Edouard Lescot <edouard.lescot@gmail.com>
16+
* @author Oskar Stark <oskarstark@googlemail.com>
17+
*/
18+
interface ActionElementInterface
19+
{
20+
publicfunctiontoArray():array;
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\Notifier\Bridge\MicrosoftTeams\Action;
13+
14+
/**
15+
* @author Edouard Lescot <edouard.lescot@gmail.com>
16+
* @author Oskar Stark <oskarstark@googlemail.com>
17+
*/
18+
interface ActionInterface
19+
{
20+
publicfunctiontoArray():array;
21+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\Notifier\Bridge\MicrosoftTeams\Action;
13+
14+
/**
15+
* @author Edouard Lescot <edouard.lescot@gmail.com>
16+
* @author Oskar Stark <oskarstark@googlemail.com>
17+
*
18+
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#header
19+
*/
20+
class HeaderActionElementimplements ActionElementInterface
21+
{
22+
protected$options = [];
23+
24+
publicfunctionname(string$name):self
25+
{
26+
$this->options['name'] =$name;
27+
28+
return$this;
29+
}
30+
31+
publicfunctionvalue(string$value):self
32+
{
33+
$this->options['value'] =$value;
34+
35+
return$this;
36+
}
37+
38+
publicfunctiontoArray():array
39+
{
40+
return$this->options;
41+
}
42+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\Notifier\Bridge\MicrosoftTeams\Action;
13+
14+
/**
15+
* @author Edouard Lescot <edouard.lescot@gmail.com>
16+
* @author Oskar Stark <oskarstark@googlemail.com>
17+
*
18+
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#httppost-action
19+
*/
20+
class HttpPostActionimplements ActionCardCompatibleActionInterface
21+
{
22+
protected$options = [];
23+
24+
publicfunctionname(string$name):self
25+
{
26+
$this->options['name'] =$name;
27+
28+
return$this;
29+
}
30+
31+
publicfunctiontarget(string$url):self
32+
{
33+
$this->options['target'] =$url;
34+
35+
return$this;
36+
}
37+
38+
publicfunctionheader(HeaderActionElement$header):self
39+
{
40+
$this->options['headers'][] =$header->toArray();
41+
42+
return$this;
43+
}
44+
45+
publicfunctionbody(string$body):self
46+
{
47+
$this->options['body'] =$body;
48+
49+
return$this;
50+
}
51+
52+
publicfunctionbodyContentType(string$contentType):self
53+
{
54+
$this->options['bodyContentType'] =$contentType;
55+
56+
return$this;
57+
}
58+
59+
publicfunctiontoArray():array
60+
{
61+
$this->options['@type'] ='HttpPOST';
62+
63+
return$this->options;
64+
}
65+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\Notifier\Bridge\MicrosoftTeams\Action;
13+
14+
/**
15+
* @author Edouard Lescot <edouard.lescot@gmail.com>
16+
* @author Oskar Stark <oskarstark@googlemail.com>
17+
*
18+
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#invokeaddincommand-action
19+
*/
20+
class InvokeAddInCommandActionimplements ActionInterface
21+
{
22+
protected$options = [];
23+
24+
publicfunctionname(string$name):self
25+
{
26+
$this->options['name'] =$name;
27+
28+
return$this;
29+
}
30+
31+
publicfunctionaddInId(string$addInId):self
32+
{
33+
$this->options['addInId'] =$addInId;
34+
35+
return$this;
36+
}
37+
38+
publicfunctiondesktopCommandId(string$desktopCommandId):self
39+
{
40+
$this->options['desktopCommandId'] =$desktopCommandId;
41+
42+
return$this;
43+
}
44+
45+
publicfunctioninitializationContext(array$context):self
46+
{
47+
$this->options['initializationContext'] =$context;
48+
49+
return$this;
50+
}
51+
52+
publicfunctiontoArray():array
53+
{
54+
$this->options['@type'] ='InvokeAddInCommand';
55+
56+
return$this->options;
57+
}
58+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespaceSymfony\Component\Notifier\Bridge\MicrosoftTeams\Action;
13+
14+
useSymfony\Component\Notifier\Exception\InvalidArgumentException;
15+
16+
/**
17+
* @author Edouard Lescot <edouard.lescot@gmail.com>
18+
* @author Oskar Stark <oskarstark@googlemail.com>
19+
*
20+
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#openuri-action
21+
*/
22+
class OpenUriActionimplements ActionCardCompatibleActionInterface
23+
{
24+
privateconstOPERATING_SYSTEMS = [
25+
'android',
26+
'default',
27+
'iOS',
28+
'windows',
29+
];
30+
31+
protected$options = [];
32+
33+
publicfunctionname(string$name):self
34+
{
35+
$this->options['name'] =$name;
36+
37+
return$this;
38+
}
39+
40+
publicfunctiontarget(string$uri,string$os ='default'):self
41+
{
42+
if (!\in_array($os,self::OPERATING_SYSTEMS)) {
43+
thrownewInvalidArgumentException(sprintf('Supported operating systems for "%s" method are: "%s".',__METHOD__,implode('", "',self::OPERATING_SYSTEMS)));
44+
}
45+
46+
$this->options['targets'][] = ['os' =>$os,'uri' =>$uri];
47+
48+
return$this;
49+
}
50+
51+
publicfunctiontoArray():array
52+
{
53+
$this->options['@type'] ='OpenUri';
54+
55+
return$this->options;
56+
}
57+
}

‎src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ CHANGELOG
55
---
66

77
* Add the bridge
8+
* Add options support

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp