getExperimentByIdAssignWithHttpInfo method
Is the variant one subject is bucketed into, and the payload that variant carries.
Is the variant one subject is bucketed into, and the payload that variant carries. The bucketing is a deterministic hash of the subject, so the same subject gets the same arm on every call for as long as the flag definition is unchanged — and this is a pure READ: it records nothing. In particular it does NOT record an exposure. The caller's SDK must emit the experiment's exposure event itself, or the analysis has an empty denominator and every arm measures zero. An empty variant with on false is not an error — it means the flag returned nothing for this subject, so the subject is not enrolled. A flags engine that is unavailable refuses rather than defaulting to an arm. Requires a validated principal, and the experiment must exist in the caller's org and project.
Note: This method returns the HTTP Response.
Parameters:
-
String id (required): ID is the experiment the URL names.
-
String subject (required): Subject is the unit to bucket — a user, org, session or audience key, matching the experiment's subjectKind.
-
String props: Props is a JSON object of person properties for targeting. A value that is not valid JSON is dropped rather than refused, so a malformed one changes the bucketing without saying so.
Implementation
Future<Response> getExperimentByIdAssignWithHttpInfo(String id, String subject, { String? props, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/experiment/{id}/assign'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'subject', subject));
if (props != null) {
queryParams.addAll(_queryParams('', 'props', props));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}