|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Text; |
| 4 | + |
| 5 | +namespace Amazon.Lambda.S3Events |
| 6 | +{ |
| 7 | + /// <summary> |
| 8 | + /// Class representing the S3 Object Lambda event. |
| 9 | + /// |
| 10 | + /// S3 Developer Guide explaining the event data. |
| 11 | + /// https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-writing-lambda.html |
| 12 | + /// </summary> |
| 13 | + public class S3ObjectLambdaEvent |
| 14 | + { |
| 15 | + /// <summary> |
| 16 | + /// The Amazon S3 request ID for this request. We recommend that you log this value to help with debugging. |
| 17 | + /// </summary> |
| 18 | +#if NETCOREAPP3_1 |
| 19 | + [System.Text.Json.Serialization.JsonPropertyName("xAmzRequestId")] |
| 20 | +#endif |
| 21 | + public string XAmzRequestId { get; set; } |
| 22 | + |
| 23 | + /// <summary> |
| 24 | + /// The input and output details for connections to Amazon S3 and S3 Object Lambda. |
| 25 | + /// </summary> |
| 26 | + public GetObjectContextType GetObjectContext { get; set; } |
| 27 | + |
| 28 | + /// <summary> |
| 29 | + /// Configuration information about the S3 Object Lambda access point. |
| 30 | + /// </summary> |
| 31 | + public ConfigurationType Configuration { get; set; } |
| 32 | + |
| 33 | + /// <summary> |
| 34 | + /// Information about the original call to S3 Object Lambda. |
| 35 | + /// </summary> |
| 36 | + public UserRequestType UserRequest { get; set; } |
| 37 | + |
| 38 | + /// <summary> |
| 39 | + /// Details about the identity that made the call to S3 Object Lambda. |
| 40 | + /// </summary> |
| 41 | + public UserIdentityType UserIdentity { get; set; } |
| 42 | + |
| 43 | + /// <summary> |
| 44 | + /// The version ID of the context provided. The format of this field is {Major Version}.{Minor Version}. |
| 45 | + /// </summary> |
| 46 | + public string ProtocolVersion { get; set; } |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// The input and output details for connections to Amazon S3 and S3 Object Lambda. |
| 50 | + /// </summary> |
| 51 | + public class GetObjectContextType |
| 52 | + { |
| 53 | + /// <summary> |
| 54 | + /// A presigned URL that can be used to fetch the original object from Amazon S3. The URL is signed |
| 55 | + /// using the original caller’s identity, and their permissions will apply when the URL is used. |
| 56 | + /// If there are signed headers in the URL, the Lambda function must include these in the call to |
| 57 | + /// Amazon S3, except for the Host. |
| 58 | + /// </summary> |
| 59 | + public string InputS3Url { get; set; } |
| 60 | + |
| 61 | + /// <summary> |
| 62 | + /// A presigned URL that can be used to fetch the original object from Amazon S3. The URL is signed |
| 63 | + /// using the original caller’s identity, and their permissions will apply when the URL is used. If |
| 64 | + /// there are signed headers in the URL, the Lambda function must include these in the call to |
| 65 | + /// Amazon S3, except for the Host. |
| 66 | + /// </summary> |
| 67 | + public string OutputRoute { get; set; } |
| 68 | + |
| 69 | + /// <summary> |
| 70 | + /// An opaque token used by S3 Object Lambda to match the WriteGetObjectResponse call with the |
| 71 | + /// original caller. |
| 72 | + /// </summary> |
| 73 | + public string OutputToken { get; set; } |
| 74 | + } |
| 75 | + |
| 76 | + /// <summary> |
| 77 | + /// Configuration information about the S3 Object Lambda access point. |
| 78 | + /// </summary> |
| 79 | + public class ConfigurationType |
| 80 | + { |
| 81 | + /// <summary> |
| 82 | + /// The Amazon Resource Name (ARN) of the S3 Object Lambda access point that received this request. |
| 83 | + /// </summary> |
| 84 | + public string AccessPointArn { get; set; } |
| 85 | + |
| 86 | + /// <summary> |
| 87 | + /// The ARN of the supporting access point that is specified in the S3 Object Lambda access point configuration. |
| 88 | + /// </summary> |
| 89 | + public string SupportingAccessPointArn { get; set; } |
| 90 | + |
| 91 | + /// <summary> |
| 92 | + /// ustom data that is applied to the S3 Object Lambda access point configuration. S3 Object Lambda treats |
| 93 | + /// this as an opaque string, so it might need to be decoded before use. |
| 94 | + /// </summary> |
| 95 | + public string Payload { get; set; } |
| 96 | + |
| 97 | + } |
| 98 | + |
| 99 | + /// <summary> |
| 100 | + /// Information about the original call to S3 Object Lambda. |
| 101 | + /// </summary> |
| 102 | + public class UserRequestType |
| 103 | + { |
| 104 | + /// <summary> |
| 105 | + /// The decoded URL of the request as received by S3 Object Lambda, |
| 106 | + /// excluding any authorization-related query parameters. |
| 107 | + /// </summary> |
| 108 | + public string Url { get; set; } |
| 109 | + |
| 110 | + /// <summary> |
| 111 | + /// A map of string to strings containing the HTTP headers and their values from the original call, excluding |
| 112 | + /// any authorization-related headers. If the same header appears multiple times, their values are |
| 113 | + /// combined into a comma-delimited list. |
| 114 | + /// </summary> |
| 115 | + public IDictionary<string, string> Headers { get; set; } |
| 116 | + } |
| 117 | + |
| 118 | + /// <summary> |
| 119 | + /// Details about the identity that made the call to S3 Object Lambda. |
| 120 | + /// </summary> |
| 121 | + public class UserIdentityType |
| 122 | + { |
| 123 | + /// <summary> |
| 124 | + /// The type of identity. |
| 125 | + /// </summary> |
| 126 | + public string Type { get; set; } |
| 127 | + |
| 128 | + /// <summary> |
| 129 | + /// The unique identifier for the identity that made the call. |
| 130 | + /// </summary> |
| 131 | + public string PrincipalId { get; set; } |
| 132 | + |
| 133 | + /// <summary> |
| 134 | + /// The ARN of the principal that made the call. The last section of the ARN contains the user or role that made the call. |
| 135 | + /// </summary> |
| 136 | + public string Arn { get; set; } |
| 137 | + |
| 138 | + /// <summary> |
| 139 | + /// The AWS account to which the identity belongs. |
| 140 | + /// </summary> |
| 141 | + public string AccountId { get; set; } |
| 142 | + |
| 143 | + /// <summary> |
| 144 | + /// The AWS Access Key Id for the identity. |
| 145 | + /// </summary> |
| 146 | + public string AccessKeyId { get; set; } |
| 147 | + |
| 148 | + /// <summary> |
| 149 | + /// If the request was made with temporary security credentials, this element provides information about the |
| 150 | + /// session that was created for those credentials. |
| 151 | + /// </summary> |
| 152 | + public SessionContextType SessionContext { get; set; } |
| 153 | + } |
| 154 | + |
| 155 | + /// <summary> |
| 156 | + /// The information about temporary session credentials used by the identity. |
| 157 | + /// </summary> |
| 158 | + public class SessionContextType |
| 159 | + { |
| 160 | + /// <summary> |
| 161 | + /// Attributes for the temporary session credentials |
| 162 | + /// </summary> |
| 163 | + public SessionContextAttributesType Attributes { get; set; } |
| 164 | + |
| 165 | + /// <summary> |
| 166 | + /// If the request was made with temporary security credentials, this element provides information about how the credentials were obtained. |
| 167 | + /// </summary> |
| 168 | + public SessionIssuerType SessionIssuer { get; set; } |
| 169 | + } |
| 170 | + |
| 171 | + /// <summary> |
| 172 | + /// Attributes of the temporary session credentials |
| 173 | + /// </summary> |
| 174 | + public class SessionContextAttributesType |
| 175 | + { |
| 176 | + /// <summary> |
| 177 | + /// Identifies whether MFA authentication was used when obtaining temporary credentials. |
| 178 | + /// </summary> |
| 179 | + public string MfaAuthenticated { get; set; } |
| 180 | + |
| 181 | + /// <summary> |
| 182 | + /// The create date of the temporary session credentials. |
| 183 | + /// </summary> |
| 184 | + public string CreationDate { get; set; } |
| 185 | + } |
| 186 | + |
| 187 | + /// <summary> |
| 188 | + /// Information about the issuer of the temporary session credentials. |
| 189 | + /// </summary> |
| 190 | + public class SessionIssuerType |
| 191 | + { |
| 192 | + /// <summary> |
| 193 | + /// The type of issuer of the temporary session credentials. |
| 194 | + /// </summary> |
| 195 | + public string Type { get; set; } |
| 196 | + |
| 197 | + /// <summary> |
| 198 | + /// The principal id of the issuer of the temporary session credentials. |
| 199 | + /// </summary> |
| 200 | + public string PrincipalId { get; set; } |
| 201 | + |
| 202 | + /// <summary> |
| 203 | + /// The arn of the issuer of the temporary session credentials. |
| 204 | + /// </summary> |
| 205 | + public string Arn { get; set; } |
| 206 | + |
| 207 | + /// <summary> |
| 208 | + /// The account id of the issuer of the temporary session credentials. |
| 209 | + /// </summary> |
| 210 | + public string AccountId { get; set; } |
| 211 | + |
| 212 | + /// <summary> |
| 213 | + /// The user name of the issuer of the temporary session credentials. |
| 214 | + /// </summary> |
| 215 | + public string UserName { get; set; } |
| 216 | + } |
| 217 | + } |
| 218 | +} |
0 commit comments