コード例 #1
0
        public void CreateOptionListTest()
        {
            var optionList = new OptionList
                {
                    name = "sample list",
                    elements = new List<Option>()
                        {
                            new Option()
                                {
                                    displayName = "sample name",
                                    value = "sample value"
                                }
                        }
                };

            OptionList returnedList = null;
            try
            {
                returnedList = _helper.CreateOptionList(optionList);
                Assert.IsNotNull(returnedList);
            }
            finally
            {
                if (returnedList != null)
                {
                    _helper.DeleteOptionList(returnedList.id);
                }
            }
        }
コード例 #2
0
        public OptionList CreateOptionList(OptionList optionList)
        {
            var request = new RestRequest(Method.POST)
                {
                    RequestFormat = DataFormat.Json,
                    Resource = string.Format("/assets/optionList")
                };
            request.AddBody(optionList);

            var response = _client.Execute<OptionList>(request);

            return response.Data;
        }