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

Commit14eea2a

Browse files
committed
[Notifier] Add options to Microsoft Teams notifier
1 parentddb48bb commit14eea2a

File tree

26 files changed

+1204
-1
lines changed

26 files changed

+1204
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
*/
17+
abstractclass AbstractMicrosoftTeamsActionimplements MicrosoftTeamsActionInterface
18+
{
19+
protected$options = [];
20+
21+
publicfunctiontoArray():array
22+
{
23+
return$this->options;
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
*/
17+
abstractclass AbstractMicrosoftTeamsActionElementimplements MicrosoftTeamsActionElementInterface
18+
{
19+
protected$options = [];
20+
21+
publicfunctiontoArray():array
22+
{
23+
return$this->options;
24+
}
25+
}
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+
*/
17+
abstractclass AbstractMicrosoftTeamsActionInputimplements MicrosoftTeamsActionInterface
18+
{
19+
protected$options = [];
20+
21+
/**
22+
* @return $this
23+
*/
24+
publicfunctionid(string$id):self
25+
{
26+
$this->options['id'] =$id;
27+
28+
return$this;
29+
}
30+
31+
/**
32+
* @return $this
33+
*/
34+
publicfunctionisRequired(bool$required):self
35+
{
36+
$this->options['isRequired'] =$required;
37+
38+
return$this;
39+
}
40+
41+
/**
42+
* @return $this
43+
*/
44+
publicfunctiontitle(string$title):self
45+
{
46+
$this->options['title'] =$title;
47+
48+
return$this;
49+
}
50+
51+
/**
52+
* @return $this
53+
*/
54+
publicfunctionvalue(string$value):self
55+
{
56+
$this->options['value'] =$value;
57+
58+
return$this;
59+
}
60+
61+
publicfunctiontoArray():array
62+
{
63+
return$this->options;
64+
}
65+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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\LogicException;
15+
16+
/**
17+
* @author Edouard Lescot <edouard.lescot@gmail.com>
18+
*
19+
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#actioncard-action
20+
*/
21+
class MicrosoftTeamsActionCardActionextends AbstractMicrosoftTeamsAction
22+
{
23+
/**
24+
* @return $this
25+
*/
26+
publicfunctionname(string$name):self
27+
{
28+
$this->options['name'] =$name;
29+
30+
return$this;
31+
}
32+
33+
/**
34+
* @return $this
35+
*/
36+
publicfunctioninput(MicrosoftTeamsActionInputInterface$inputAction):self
37+
{
38+
$this->options['inputs'][] =$inputAction->toArray();
39+
40+
return$this;
41+
}
42+
43+
/**
44+
* @return $this
45+
*/
46+
publicfunctionaction(MicrosoftTeamsActionInterface$action):self
47+
{
48+
if (!\in_array(\get_class($action), [MicrosoftTeamsHttpPostAction::class, MicrosoftTeamsOpenUriAction::class])) {
49+
thrownewLogicException(sprintf('"%s" must be an instance of "%s" or "%s".',\get_class($action), MicrosoftTeamsHttpPostAction::class, MicrosoftTeamsOpenUriAction::class));
50+
}
51+
52+
$this->options['actions'][] =$action->toArray();
53+
54+
return$this;
55+
}
56+
57+
publicfunctiontoArray():array
58+
{
59+
$this->options['@type'] ='ActionCard';
60+
61+
returnparent::toArray();
62+
}
63+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
*/
17+
interface MicrosoftTeamsActionElementInterface
18+
{
19+
publicfunctiontoArray():array;
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
*/
17+
interface MicrosoftTeamsActionInputInterface
18+
{
19+
publicfunctiontoArray():array;
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
*/
17+
interface MicrosoftTeamsActionInterface
18+
{
19+
publicfunctiontoArray():array;
20+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
*
17+
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#dateinput
18+
*/
19+
class MicrosoftTeamsDateInputActionextends AbstractMicrosoftTeamsActionInput
20+
{
21+
/**
22+
* @return $this
23+
*/
24+
publicfunctionincludeTime(bool$includeTime):self
25+
{
26+
$this->options['includeTime'] =$includeTime;
27+
28+
return$this;
29+
}
30+
31+
publicfunctiontoArray():array
32+
{
33+
$this->options['@type'] ='DateInput';
34+
35+
returnparent::toArray();
36+
}
37+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
*
17+
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#header
18+
*/
19+
class MicrosoftTeamsHeaderActionElementextends AbstractMicrosoftTeamsActionElement
20+
{
21+
/**
22+
* @return $this
23+
*/
24+
publicfunctionname(string$name):self
25+
{
26+
$this->options['name'] =$name;
27+
28+
return$this;
29+
}
30+
31+
/**
32+
* @return $this
33+
*/
34+
publicfunctionvalue(string$value):self
35+
{
36+
$this->options['value'] =$value;
37+
38+
return$this;
39+
}
40+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp