Skip to content

Instantly share code, notes, and snippets.

/-

Created February 25, 2016 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/9ad9df12f07e9a6fdf4c to your computer and use it in GitHub Desktop.
Save anonymous/9ad9df12f07e9a6fdf4c to your computer and use it in GitHub Desktop.
{"swagger":"2.0","info":{"version":"","title":""},"definitions":{"OptionTemplateAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"OptionIntAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"OptionDayPartAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"SelectorUTCTime":{"type":"object","description":"Could either be 'explicit', 'algorithmic', or empty","properties":{"algorithmic":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"explicit":{"$ref":"#/definitions/UTCTime"}}},"SelectorTimeOfDay":{"type":"object","description":"Could either be 'explicit', 'algorithmic', or empty","properties":{"algorithmic":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"explicit":{"$ref":"#/definitions/TimeOfDay"}}},"ExperimentVariantRevision":{"required":["variantId","authorId","authorName","timestamp"],"type":"object","properties":{"authorName":{"type":"string"},"timestamp":{"$ref":"#/definitions/UTCTime"}}},"AuthorId":{"type":"string"},"SelectorText":{"type":"object","description":"Could either be 'explicit', 'algorithmic', or empty","properties":{"algorithmic":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"explicit":{"type":"string"}}},"SelectorBool":{"type":"object","description":"Could either be 'explicit', 'algorithmic', or empty","properties":{"algorithmic":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"explicit":{"type":"boolean"}}},"DateRange":{"maxLength":2,"example":[[2016,2,17],[2016,3,18]],"items":{"$ref":"#/definitions/Day"},"minLength":2,"type":"array","description":"Two-element Day array representing (fromDay, toDay)"},"WorkflowType":{"type":"string","enum":["OneStarTestWorkflow","TestWorkflow","DiscountWorkflow","EmailWorkflow","QuestWorkflow","DashWorkflow","MOPWorkflow","BonusStarsWorkflow","StreakWorkflow"]},"ExperimentState":{"type":"string","enum":["created","configured","published","active","complete","archived"]},"ExperimentVariant":{"required":["name","experimentId","type","config"],"type":"object","properties":{"config":{"$ref":"#/definitions/WorkflowConfig"},"relevantControlVariantId":{"type":"string"},"experimentId":{"type":"integer"},"name":{"type":"string"},"revisions":{"items":{"$ref":"#/definitions/ExperimentVariantRevision"},"type":"array"},"type":{"$ref":"#/definitions/WorkflowType"},"description":{"type":"string"},"segmentId":{"type":"integer"}}},"SelectorDateRange":{"type":"object","description":"Could either be 'explicit', 'algorithmic', or empty","properties":{"algorithmic":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"explicit":{"$ref":"#/definitions/DateRange"}}},"ShortProductCategory":{"items":[{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},{"type":"string"}],"type":"array"},"OptionTimeAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"OptionStringAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"Experiment":{"required":["name","state"],"type":"object","properties":{"activateAt":{"$ref":"#/definitions/UTCTime"},"state":{"$ref":"#/definitions/ExperimentState"},"completeAt":{"$ref":"#/definitions/UTCTime"},"name":{"type":"string"},"revisions":{"items":{"$ref":"#/definitions/ExperimentRevision"},"type":"array"},"description":{"type":"string"}}},"Day":{"maxLength":3,"example":[2016,2,18],"items":{"maximum":9223372036854775807,"minimum":-9223372036854775808,"type":"integer"},"minLength":3,"type":"array","description":"Three-element integer array representing (year, month, day)"},"ProductCategoryAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"SelectorInt64":{"type":"object","description":"Could either be 'explicit', 'algorithmic', or empty","properties":{"algorithmic":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"explicit":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"}}},"OptionDateRangeAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"UTCTime":{"format":"yyyy-mm-ddThh:MM:ssZ","type":"string"},"OptionBoolAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"ExperimentRevision":{"required":["experimentId","authorId","authorName","timestamp"],"type":"object","properties":{"authorName":{"type":"string"},"timestamp":{"$ref":"#/definitions/UTCTime"}}},"OptionDateTimeAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"TimeOfDay":{"required":["hour","min","sec"],"type":"object","properties":{"sec":{"maximum":9223372036854775807,"minimum":-9223372036854775808,"type":"integer"},"min":{"maximum":9223372036854775807,"minimum":-9223372036854775808,"type":"integer"},"hour":{"maximum":9223372036854775807,"minimum":-9223372036854775808,"type":"integer"}}},"Segment":{"required":["name","testSegment"],"type":"object","properties":{"testSegment":{"type":"boolean"},"name":{"type":"string"},"id":{"type":"integer"}}},"DayPart":{"type":"string","enum":["PM","AM","AllDayParts"]},"OptionRewardAlgorithm":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer"}}},"Option":{"minProperties":1,"maxProperties":1,"type":"object","properties":{"OptionReward":{"$ref":"#/definitions/SelectorInt"},"OptionDateTime":{"$ref":"#/definitions/SelectorUTCTime"},"OptionDateRange":{"$ref":"#/definitions/SelectorDateRange"},"OptionTemplate":{"$ref":"#/definitions/SelectorInt64"},"OptionTime":{"$ref":"#/definitions/SelectorTimeOfDay"},"OptionString":{"$ref":"#/definitions/SelectorText"},"OptionBool":{"$ref":"#/definitions/SelectorBool"},"OptionDayPart":{"$ref":"#/definitions/SelectorDayPart"},"OptionProduct":{"$ref":"#/definitions/SelectorInt64"},"OptionInt":{"$ref":"#/definitions/SelectorInt"}}},"SelectorInt":{"type":"object","description":"Could either be 'explicit', 'algorithmic', or empty","properties":{"algorithmic":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"explicit":{"maximum":9223372036854775807,"minimum":-9223372036854775808,"type":"integer"}}},"SelectorDayPart":{"type":"object","description":"Could either be 'explicit', 'algorithmic', or empty","properties":{"algorithmic":{"maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"explicit":{"$ref":"#/definitions/DayPart"}}},"ShortEmailBodyTemplate":{"items":[{"type":"integer"},{"type":"string"}],"type":"array"},"WorkflowConfig":{"type":"object","description":"Can have any number of lower-case properties associated with an Option","properties":{"(any)":{"$ref":"#/definitions/Option"}}}},"paths":{"/api/workflows/variants/{id}":{"post":{"consumes":["application/json"],"responses":{"404":{"description":"`id` not found"},"400":{"description":"Invalid `body`"},"201":{"schema":{"$ref":"#/definitions/ExperimentVariant"},"description":""}},"produces":["application/json"],"parameters":[{"required":true,"in":"path","name":"id","type":"integer"},{"required":true,"schema":{"$ref":"#/definitions/ExperimentVariant"},"in":"body","name":"body"}]},"get":{"responses":{"404":{"description":"`id` not found"},"200":{"schema":{"$ref":"#/definitions/ExperimentVariant"},"description":""}},"produces":["application/json"],"parameters":[{"required":true,"in":"path","name":"id","type":"integer"}]},"delete":{"responses":{"404":{"description":"`id` not found"},"204":{"description":""}},"produces":["application/json"],"parameters":[{"required":true,"in":"path","name":"id","type":"integer"}]}},"/api/workflows/segments":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/Segment"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/daterange":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionDateRangeAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/bool":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionBoolAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/experiments":{"post":{"consumes":["application/json"],"responses":{"400":{"description":"Invalid `body`"},"201":{"schema":{"$ref":"#/definitions/Experiment"},"description":""}},"produces":["application/json"],"parameters":[{"required":true,"schema":{"$ref":"#/definitions/Experiment"},"in":"body","name":"body"}]},"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/Experiment"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/explicit/template":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/ShortEmailBodyTemplate"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/string":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionStringAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/time":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionTimeAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/template":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionTemplateAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/daypart":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionDayPartAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/product":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/ProductCategoryAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/int":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionIntAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/experiments/{id}/variants":{"get":{"responses":{"404":{"description":"`id` not found"},"200":{"schema":{"items":{"$ref":"#/definitions/ExperimentVariant"},"type":"array"},"description":""}},"produces":["application/json"],"parameters":[{"required":true,"in":"path","name":"id","type":"integer"}]}},"/api/workflows/explicit/product":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/ShortProductCategory"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/algorithms/datetime":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionDateTimeAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/variants":{"post":{"consumes":["application/json"],"responses":{"400":{"description":"Invalid `body`"},"201":{"schema":{"$ref":"#/definitions/ExperimentVariant"},"description":""}},"produces":["application/json"],"parameters":[{"required":true,"schema":{"$ref":"#/definitions/ExperimentVariant"},"in":"body","name":"body"}]}},"/api/workflows/algorithms/reward":{"get":{"responses":{"200":{"schema":{"items":{"$ref":"#/definitions/OptionRewardAlgorithm"},"type":"array"},"description":""}},"produces":["application/json"]}},"/api/workflows/experiments/{id}":{"post":{"consumes":["application/json"],"responses":{"404":{"description":"`id` not found"},"400":{"description":"Invalid `body`"},"201":{"schema":{"$ref":"#/definitions/Experiment"},"description":""}},"produces":["application/json"],"parameters":[{"required":true,"in":"path","name":"id","type":"integer"},{"required":true,"schema":{"$ref":"#/definitions/Experiment"},"in":"body","name":"body"}]},"get":{"responses":{"404":{"description":"`id` not found"},"200":{"schema":{"$ref":"#/definitions/Experiment"},"description":""}},"produces":["application/json"],"parameters":[{"required":true,"in":"path","name":"id","type":"integer"}]},"delete":{"responses":{"404":{"description":"`id` not found"},"204":{"description":""}},"produces":["application/json"],"parameters":[{"required":true,"in":"path","name":"id","type":"integer"}]}},"/api/workflows/experiments/{id}/state":{"post":{"consumes":["application/json"],"responses":{"404":{"description":"`id` not found"},"400":{"description":"Invalid `body`"},"201":{"schema":{"$ref":"#/definitions/ExperimentState"},"description":""}},"produces":["application/json"],"parameters":[{"required":true,"in":"path","name":"id","type":"integer"},{"required":true,"schema":{"$ref":"#/definitions/ExperimentState"},"in":"body","name":"body"}]}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment