Class: RemotionLambda::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/sdk.rb,
lib/remotion_lambda/sdk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(region: ENV.fetch('AWS_REGION', 'us-east-1'), aws_profile: nil) ⇒ Client



10
11
12
13
14
15
16
17
# File 'lib/sdk.rb', line 10

def initialize(
  region: ENV.fetch('AWS_REGION', 'us-east-1'),
  aws_profile: nil
)
  @region = region
  @aws_profile = aws_profile
  @lambda_client = create_lambda_client
end

Instance Attribute Details

#bucket_nameObject (readonly)

Returns the value of attribute bucket_name.



8
9
10
# File 'lib/sdk.rb', line 8

def bucket_name
  @bucket_name
end

#serve_urlObject (readonly)

Returns the value of attribute serve_url.



8
9
10
# File 'lib/sdk.rb', line 8

def serve_url
  @serve_url
end

Instance Method Details

#get_render_progress(function_name, payload) ⇒ Object



19
20
21
22
23
# File 'lib/sdk.rb', line 19

def get_render_progress(function_name, payload)
  body = invoke(function_name, payload)      
  raise "Failed to fetch progress: #{body['message']}" if body["type"] == "error"
  body
end

#render_media_on_lambda(function_name, payload) ⇒ Object



25
26
27
28
29
# File 'lib/sdk.rb', line 25

def render_media_on_lambda(function_name, payload)
  body = invoke(function_name, payload)      
  raise "Failed to call renderMediaOnLambda: #{body['message']}" if body["type"] == "error"
  body
end

#render_still_on_lambda(function_name, payload) ⇒ Object



31
32
33
34
35
# File 'lib/sdk.rb', line 31

def render_still_on_lambda(function_name, payload)
  body = invoke(function_name, payload)      
  raise "Failed to call renderStillOnLambda: #{body['message']}" if body["type"] == "error"
  body
end