1: <?php
2:
3: namespace Guzzle\Service\Description;
4:
5: use Guzzle\Common\ToArrayInterface;
6:
7: /**
8: * Interface defining data objects that hold the information of an API operation
9: */
10: interface OperationInterface extends ToArrayInterface
11: {
12: const TYPE_PRIMITIVE = 'primitive';
13: const TYPE_CLASS = 'class';
14: const TYPE_DOCUMENTATION = 'documentation';
15: const TYPE_MODEL = 'model';
16:
17: /**
18: * Get the service description that the operation belongs to
19: *
20: * @return ServiceDescriptionInterface|null
21: */
22: public function getServiceDescription();
23:
24: /**
25: * Set the service description that the operation belongs to
26: *
27: * @param ServiceDescriptionInterface $description Service description
28: *
29: * @return self
30: */
31: public function setServiceDescription(ServiceDescriptionInterface $description);
32:
33: /**
34: * Get the params of the operation
35: *
36: * @return array
37: */
38: public function getParams();
39:
40: /**
41: * Returns an array of parameter names
42: *
43: * @return array
44: */
45: public function getParamNames();
46:
47: /**
48: * Check if the operation has a specific parameter by name
49: *
50: * @param string $name Name of the param
51: *
52: * @return bool
53: */
54: public function hasParam($name);
55:
56: /**
57: * Get a single parameter of the operation
58: *
59: * @param string $param Parameter to retrieve by name
60: *
61: * @return Parameter|null
62: */
63: public function getParam($param);
64:
65: /**
66: * Get the HTTP method of the operation
67: *
68: * @return string|null
69: */
70: public function getHttpMethod();
71:
72: /**
73: * Get the concrete operation class that implements this operation
74: *
75: * @return string
76: */
77: public function getClass();
78:
79: /**
80: * Get the name of the operation
81: *
82: * @return string|null
83: */
84: public function getName();
85:
86: /**
87: * Get a short summary of what the operation does
88: *
89: * @return string|null
90: */
91: public function getSummary();
92:
93: /**
94: * Get a longer text field to explain the behavior of the operation
95: *
96: * @return string|null
97: */
98: public function getNotes();
99:
100: /**
101: * Get the documentation URL of the operation
102: *
103: * @return string|null
104: */
105: public function getDocumentationUrl();
106:
107: /**
108: * Get what is returned from the method. Can be a primitive, class name, or model. For example, the responseClass
109: * could be 'array', which would inherently use a responseType of 'primitive'. Using a class name would set a
110: * responseType of 'class'. Specifying a model by ID will use a responseType of 'model'.
111: *
112: * @return string|null
113: */
114: public function getResponseClass();
115:
116: /**
117: * Get information about how the response is unmarshalled: One of 'primitive', 'class', 'model', or 'documentation'
118: *
119: * @return string
120: */
121: public function getResponseType();
122:
123: /**
124: * Get notes about the response of the operation
125: *
126: * @return string|null
127: */
128: public function getResponseNotes();
129:
130: /**
131: * Get whether or not the operation is deprecated
132: *
133: * @return bool
134: */
135: public function getDeprecated();
136:
137: /**
138: * Get the URI that will be merged into the generated request
139: *
140: * @return string
141: */
142: public function getUri();
143:
144: /**
145: * Get the errors that could be encountered when executing the operation
146: *
147: * @return array
148: */
149: public function getErrorResponses();
150:
151: /**
152: * Get extra data from the operation
153: *
154: * @param string $name Name of the data point to retrieve
155: *
156: * @return mixed|null
157: */
158: public function getData($name);
159: }
160: