forked from Bandwidth/python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp_method_enum.py
More file actions
49 lines (32 loc) · 915 Bytes
/
http_method_enum.py
File metadata and controls
49 lines (32 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
"""
bandwidth
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class HttpMethodEnum(object):
"""Enumeration of an HTTP Method
Attributes:
GET: A GET Request
POST: A POST Request
PUT: A PUT Request
PATCH: A PATCH Request
DELETE: A DELETE Request
"""
GET = "GET"
POST = "POST"
PUT = "PUT"
PATCH = "PATCH"
DELETE = "DELETE"
HEAD = "HEAD"
@classmethod
def to_string(cls, val):
"""Returns the string equivalent for the Enum.
"""
for k, v in list(vars(cls).items()):
if v == val:
return k
@classmethod
def from_string(cls, str):
"""Creates an instance of the Enum from a given string.
"""
return getattr(cls, str.upper(), None)