Skip to content

Latest commit

 

History

History
212 lines (136 loc) · 5.17 KB

ConstraintApi.md

File metadata and controls

212 lines (136 loc) · 5.17 KB

Jsflagr.ConstraintApi

All URIs are relative to http://localhost/api/v1

Method HTTP request Description
createConstraint POST /flags/{flagID}/segments/{segmentID}/constraints
deleteConstraint DELETE /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
findConstraints GET /flags/{flagID}/segments/{segmentID}/constraints
putConstraint PUT /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}

createConstraint

Constraint createConstraint(flagID, segmentID, body)

Example

var Jsflagr = require('jsflagr');

var apiInstance = new Jsflagr.ConstraintApi();

var flagID = 789; // Number | numeric ID of the flag

var segmentID = 789; // Number | numeric ID of the segment

var body = new Jsflagr.CreateConstraintRequest(); // CreateConstraintRequest | create a constraint


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createConstraint(flagID, segmentID, body, callback);

Parameters

Name Type Description Notes
flagID Number numeric ID of the flag
segmentID Number numeric ID of the segment
body CreateConstraintRequest create a constraint

Return type

Constraint

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteConstraint

deleteConstraint(flagID, segmentID, constraintID)

Example

var Jsflagr = require('jsflagr');

var apiInstance = new Jsflagr.ConstraintApi();

var flagID = 789; // Number | numeric ID of the flag

var segmentID = 789; // Number | numeric ID of the segment

var constraintID = 789; // Number | numeric ID of the constraint


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteConstraint(flagID, segmentID, constraintID, callback);

Parameters

Name Type Description Notes
flagID Number numeric ID of the flag
segmentID Number numeric ID of the segment
constraintID Number numeric ID of the constraint

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

findConstraints

[Constraint] findConstraints(flagID, segmentID)

Example

var Jsflagr = require('jsflagr');

var apiInstance = new Jsflagr.ConstraintApi();

var flagID = 789; // Number | numeric ID of the flag

var segmentID = 789; // Number | numeric ID of the segment


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findConstraints(flagID, segmentID, callback);

Parameters

Name Type Description Notes
flagID Number numeric ID of the flag
segmentID Number numeric ID of the segment

Return type

[Constraint]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

putConstraint

Constraint putConstraint(flagID, segmentID, constraintID, body)

Example

var Jsflagr = require('jsflagr');

var apiInstance = new Jsflagr.ConstraintApi();

var flagID = 789; // Number | numeric ID of the flag

var segmentID = 789; // Number | numeric ID of the segment

var constraintID = 789; // Number | numeric ID of the constraint

var body = new Jsflagr.CreateConstraintRequest(); // CreateConstraintRequest | create a constraint


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.putConstraint(flagID, segmentID, constraintID, body, callback);

Parameters

Name Type Description Notes
flagID Number numeric ID of the flag
segmentID Number numeric ID of the segment
constraintID Number numeric ID of the constraint
body CreateConstraintRequest create a constraint

Return type

Constraint

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json