Class: AWSCDK::APIGateway::JsonWithStandardFieldProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gateway/json_with_standard_field_props.rb

Overview

Properties for controlling items output in JSON standard format.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(caller:, http_method:, ip:, protocol:, request_time:, resource_path:, response_length:, status:, user:) ⇒ JsonWithStandardFieldProps

Returns a new instance of JsonWithStandardFieldProps.

Parameters:

  • caller (Boolean)

    If this flag is enabled, the principal identifier of the caller will be output to the log.

  • http_method (Boolean)

    If this flag is enabled, the http method will be output to the log.

  • ip (Boolean)

    If this flag is enabled, the source IP of request will be output to the log.

  • protocol (Boolean)

    If this flag is enabled, the request protocol will be output to the log.

  • request_time (Boolean)

    If this flag is enabled, the CLF-formatted request time((dd/MMM/yyyy:HH:mm:ss +-hhmm) will be output to the log.

  • resource_path (Boolean)

    If this flag is enabled, the path to your resource will be output to the log.

  • response_length (Boolean)

    If this flag is enabled, the response payload length will be output to the log.

  • status (Boolean)

    If this flag is enabled, the method response status will be output to the log.

  • user (Boolean)

    If this flag is enabled, the principal identifier of the user will be output to the log.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'api_gateway/json_with_standard_field_props.rb', line 16

def initialize(caller:, http_method:, ip:, protocol:, request_time:, resource_path:, response_length:, status:, user:)
  @caller = caller
  Jsii::Type.check_type(@caller, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "caller")
  @http_method = http_method
  Jsii::Type.check_type(@http_method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "httpMethod")
  @ip = ip
  Jsii::Type.check_type(@ip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ip")
  @protocol = protocol
  Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "protocol")
  @request_time = request_time
  Jsii::Type.check_type(@request_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "requestTime")
  @resource_path = resource_path
  Jsii::Type.check_type(@resource_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "resourcePath")
  @response_length = response_length
  Jsii::Type.check_type(@response_length, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "responseLength")
  @status = status
  Jsii::Type.check_type(@status, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "status")
  @user = user
  Jsii::Type.check_type(@user, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "user")
end

Instance Attribute Details

#callerBoolean (readonly)

If this flag is enabled, the principal identifier of the caller will be output to the log.

Returns:

  • (Boolean)


40
41
42
# File 'api_gateway/json_with_standard_field_props.rb', line 40

def caller
  @caller
end

#http_methodBoolean (readonly)

If this flag is enabled, the http method will be output to the log.

Returns:

  • (Boolean)


44
45
46
# File 'api_gateway/json_with_standard_field_props.rb', line 44

def http_method
  @http_method
end

#ipBoolean (readonly)

If this flag is enabled, the source IP of request will be output to the log.

Returns:

  • (Boolean)


48
49
50
# File 'api_gateway/json_with_standard_field_props.rb', line 48

def ip
  @ip
end

#protocolBoolean (readonly)

If this flag is enabled, the request protocol will be output to the log.

Returns:

  • (Boolean)


52
53
54
# File 'api_gateway/json_with_standard_field_props.rb', line 52

def protocol
  @protocol
end

#request_timeBoolean (readonly)

If this flag is enabled, the CLF-formatted request time((dd/MMM/yyyy:HH:mm:ss +-hhmm) will be output to the log.

Returns:

  • (Boolean)


56
57
58
# File 'api_gateway/json_with_standard_field_props.rb', line 56

def request_time
  @request_time
end

#resource_pathBoolean (readonly)

If this flag is enabled, the path to your resource will be output to the log.

Returns:

  • (Boolean)


60
61
62
# File 'api_gateway/json_with_standard_field_props.rb', line 60

def resource_path
  @resource_path
end

#response_lengthBoolean (readonly)

If this flag is enabled, the response payload length will be output to the log.

Returns:

  • (Boolean)


64
65
66
# File 'api_gateway/json_with_standard_field_props.rb', line 64

def response_length
  @response_length
end

#statusBoolean (readonly)

If this flag is enabled, the method response status will be output to the log.

Returns:

  • (Boolean)


68
69
70
# File 'api_gateway/json_with_standard_field_props.rb', line 68

def status
  @status
end

#userBoolean (readonly)

If this flag is enabled, the principal identifier of the user will be output to the log.

Returns:

  • (Boolean)


72
73
74
# File 'api_gateway/json_with_standard_field_props.rb', line 72

def user
  @user
end

Class Method Details

.jsii_propertiesObject



74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'api_gateway/json_with_standard_field_props.rb', line 74

def self.jsii_properties
  {
    :caller => "caller",
    :http_method => "httpMethod",
    :ip => "ip",
    :protocol => "protocol",
    :request_time => "requestTime",
    :resource_path => "resourcePath",
    :response_length => "responseLength",
    :status => "status",
    :user => "user",
  }
end

Instance Method Details

#to_jsiiObject



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'api_gateway/json_with_standard_field_props.rb', line 88

def to_jsii
  result = {}
  result.merge!({
    "caller" => @caller,
    "httpMethod" => @http_method,
    "ip" => @ip,
    "protocol" => @protocol,
    "requestTime" => @request_time,
    "resourcePath" => @resource_path,
    "responseLength" => @response_length,
    "status" => @status,
    "user" => @user,
  })
  result.compact
end