RAPP Platform API
All Classes Namespaces Files Functions Variables Typedefs
SetNoiseProfile.py
Go to the documentation of this file.
1 from RappCloud.Objects import (
2  File,
3  Payload)
4 
5 from Cloud import (
6  CloudMsg,
7  CloudRequest,
8  CloudResponse)
9 
10 
11 class SetNoiseProfile(CloudMsg):
12  """ Set Noise Profile Cloud Message object """
13 
14  class Request(CloudRequest):
15  """ Set Noise Profile Cloud Request object.
16 
17  SetNoiseProfile.Request
18  """
19  def __init__(self, **kwargs):
20  """!
21  Constructor
22 
23  @param **kwargs - Keyword arguments. Apply values to the request attributes.
24  - @ref audio_source
25  - @ref audiofile
26  """
27 
28  ## Audio source data format. e.g "nao_wav_1_ch".
29  self.audio_source = ''
30  ## Path to the audio file.
31  self.audiofile = ''
32 
33  super(SetNoiseProfile.Request, self).__init__(**kwargs)
34 
35 
36  def make_payload(self):
37  """ Create and return the Payload of the Request. """
38  return Payload(audio_source = self.audio_source)
39 
40 
41  def make_files(self):
42  """ Create and return Array of File objects of the Request. """
43  return [File(self.audiofile, postfield='file')]
44 
45 
46  class Response(CloudResponse):
47  """ Set Noise Profile Cloud Response object.
48 
49  SetNoiseProfile.Response
50  """
51  def __init__(self, **kwargs):
52  """!
53  Constructor
54 
55  @param **kwargs - Keyword arguments. Apply values to the request attributes.
56  - @ref error
57  """
58 
59  ## Error message.
60  self.error = ''
61  super(SetNoiseProfile.Response, self).__init__(**kwargs)
62 
63 
64  def __init__(self, **kwargs):
65  """!
66  Constructor
67 
68  @param **kwargs - Keyword arguments. Apply values to the request attributes.
69  - @ref Request.audio_source
70  - @ref Request.audiofile
71  """
72 
73  # Create and hold the Request object for this CloudMsg
75  # Create and hold the Response object for this CloudMsg
77  super(SetNoiseProfile, self).__init__(
78  svcname='set_noise_profile', **kwargs)
79 
80