本文整理汇总了C#中Simple.RestRequest.AddUrlSegment方法的典型用法代码示例。如果您正苦于以下问题:C# RestRequest.AddUrlSegment方法的具体用法?C# RestRequest.AddUrlSegment怎么用?C# RestRequest.AddUrlSegment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simple.RestRequest
的用法示例。
在下文中一共展示了RestRequest.AddUrlSegment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMessageMedia
/// <summary>
/// Get the details for a specific Media instance.
/// </summary>
public virtual void GetMessageMedia(string messageSid, string mediaSid, Action<Media> callback)
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/Messages/{MessageSid}/Media/{MediaSid}.json";
request.AddUrlSegment("MediaSid", mediaSid);
request.AddUrlSegment("MessageSid", messageSid);
ExecuteAsync<Media>(request, (response) => callback(response));
}
示例2: GetMessageMediaAsync
/// <summary>
/// Get the details for a specific Media instance.
/// </summary>
/// <param name="mediaSid">The Sid of the media resource</param>
/// <returns></returns>
public virtual async Task<Media> GetMessageMediaAsync(string messageSid, string mediaSid)
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/Messages/{MessageSid}/Media/{MediaSid}.json";
request.AddUrlSegment("MediaSid", mediaSid);
request.AddUrlSegment("MessageSid", messageSid);
return await Execute<Media>(request);
}
示例3: GetWorkflow
/// <summary>
/// Retrieve the details for a workflow instance. Makes a GET request to a Workflow Instance resource.
/// </summary>
/// <param name="workspaceSid">The Sid of the workspace the workflow belongs to</param>
/// <param name="workflowSid">The Sid of the workflow to retrieve</param>
public virtual Workflow GetWorkflow(string workspaceSid, string workflowSid)
{
Require.Argument("WorkspaceSid", workspaceSid);
Require.Argument("WorkflowSid", workflowSid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("WorkflowSid", workflowSid);
return Execute<Workflow>(request);
}
示例4: GetTaskQueue
/// <summary>
/// Retrieve the details for a task queue instance. Makes a GET request to a TaskQueue Instance resource.
/// </summary>
/// <param name="workspaceSid">The Sid of the workspace the activity belongs to</param>
/// <param name="taskQueueSid">The Sid of the task queue to retrieve</param>
public virtual TaskQueue GetTaskQueue(string workspaceSid, string taskQueueSid)
{
Require.Argument("WorkspaceSid", workspaceSid);
Require.Argument("TaskQueueSid", taskQueueSid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("TaskQueueSid", taskQueueSid);
return Execute<TaskQueue>(request);
}
示例5: GetTaskQueue
/// <summary>
/// Retrieve the details for a task queue instance. Makes a GET request to a TaskQueue Instance resource.
/// </summary>
/// <param name="workspaceSid">The Sid of the workspace the activity belongs to</param>
/// <param name="taskQueueSid">The Sid of the task queue to retrieve</param>
/// <param name="callback">Method to call upon successful completion</param>
public virtual void GetTaskQueue(string workspaceSid, string taskQueueSid, Action<TaskQueue> callback)
{
//Require.Argument("WorkspaceSid", workspaceSid);
//Require.Argument("TaskQueueSid", taskQueueSid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("TaskQueueSid", taskQueueSid);
ExecuteAsync<TaskQueue>(request, (response) => { callback(response); });
}
示例6: GetWorkflow
/// <summary>
/// Retrieve the details for a workflow instance. Makes a GET request to a Workflow Instance resource.
/// </summary>
/// <param name="workspaceSid">The Sid of the workspace the workflow belongs to</param>
/// <param name="workflowSid">The Sid of the workflow to retrieve</param>
/// <param name="callback">Method to call upon successful completion</param>
public virtual void GetWorkflow(string workspaceSid, string workflowSid, Action<Workflow> callback)
{
//Require.Argument("WorkspaceSid", workspaceSid);
//Require.Argument("WorkflowSid", workflowSid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("WorkflowSid", workflowSid);
ExecuteAsync<Workflow>(request, (response) => { callback(response); });
}
示例7: GetActivity
/// <summary>
/// Retrieve the details for an activity instance. Makes a GET request to an Activity Instance resource.
/// </summary>
/// <param name="workspaceSid">The Sid of the workspace the activity belongs to</param>
/// <param name="activitySid">The Sid of the activity to retrieve</param>
/// <param name="callback">Method to call upon successful completion</param>
public virtual void GetActivity(string workspaceSid, string activitySid, Action<Activity> callback)
{
//Require.Argument("WorkspaceSid", workspaceSid);
//Require.Argument("ActivitySid", activitySid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/Activities/{ActivitySid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("ActivitySid", activitySid);
ExecuteAsync<Activity>(request, (response) => { callback(response); });
}
示例8: GetTaskAsync
/// <summary>
/// Retrieve the details for a task instance. Makes a GET request to a Task Instance resource.
/// </summary>
/// <param name="workspaceSid">The Sid of the workspace the activity belongs to</param>
/// <param name="taskSid">The Sid of the task to retrieve</param>
public virtual async Task<Task> GetTaskAsync(string workspaceSid, string taskSid)
{
Require.Argument("WorkspaceSid", workspaceSid);
Require.Argument("TaskSid", taskSid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/Tasks/{TaskSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("TaskSid", taskSid);
return await Execute<Task>(request);
}
示例9: GetEventAsync
/// <summary>
/// Gets the event.
/// </summary>
/// <param name="workspaceSid">Workspace sid.</param>
/// <param name="eventSid">Event sid.</param>
public virtual async Task<Event> GetEventAsync(string workspaceSid, string eventSid)
{
//Require.Argument("WorkspaceSid", workspaceSid);
//Require.Argument("EventSid", eventSid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/Events/{EventSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("EventSid", eventSid);
return await Execute<Event>(request);
}
示例10: GetActivity
/// <summary>
/// Retrieve the details for an activity instance. Makes a GET request to an Activity Instance resource.
/// </summary>
/// <param name="workspaceSid">The Sid of the workspace the activity belongs to</param>
/// <param name="activitySid">The Sid of the activity to retrieve</param>
public virtual Activity GetActivity(string workspaceSid, string activitySid)
{
//Require.Argument("WorkspaceSid", workspaceSid);
//Require.Argument("ActivitySid", activitySid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/Activities/{ActivitySid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("ActivitySid", activitySid);
return Execute<Activity>(request);
}
示例11: GetWorkerAsync
/// <summary>
/// Retrieve the details for a worker instance. Makes a GET request to a Worker Instance resource.
/// </summary>
/// <param name="workspaceSid">The Sid of the workspace the worker belongs to</param>
/// <param name="workerSid">The Sid of the worker to retrieve</param>
public virtual async Task<Worker> GetWorkerAsync(string workspaceSid, string workerSid)
{
Require.Argument("WorkspaceSid", workspaceSid);
Require.Argument("WorkerSid", workerSid);
var request = new RestRequest();
request.Resource = "Workspaces/{WorkspaceSid}/Workers/{WorkerSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("WorkerSid", workerSid);
return await Execute<Worker>(request);
}
示例12: DeleteWorkflow
/// <summary>
/// Delete a workflow.
/// </summary>
/// <returns>The workflow.</returns>
/// <param name="workspaceSid">Workspace sid.</param>
/// <param name="workflowSid">Workflow sid.</param>
/// <param name="callback">Method to call upon successful completion</param>
public virtual void DeleteWorkflow(string workspaceSid, string workflowSid, Action<DeleteStatus> callback)
{
//Require.Argument("WorkspaceSid", workspaceSid);
//Require.Argument("WorkflowSid", workflowSid);
var request = new RestRequest(Method.DELETE);
request.Resource = "Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("WorkflowSid", workflowSid);
ExecuteAsync(request, (response) => { callback(response.StatusCode == System.Net.HttpStatusCode.NoContent ? DeleteStatus.Success : DeleteStatus.Failed); });
}
示例13: DeleteWorkerAsync
/// <summary>
/// Delete a worker.
/// </summary>
/// <param name="workspaceSid">Workspace sid.</param>
/// <param name="workerSid">Worker sid.</param>
public virtual async Task<DeleteStatus> DeleteWorkerAsync(string workspaceSid, string workerSid)
{
Require.Argument("WorkspaceSid", workspaceSid);
Require.Argument("WorkerSid", workerSid);
var request = new RestRequest(Method.DELETE);
request.Resource = "Workspaces/{WorkspaceSid}/Workers/{WorkerSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("WorkerSid", workerSid);
var response = await Execute(request);
return response.StatusCode == System.Net.HttpStatusCode.NoContent ? DeleteStatus.Success : DeleteStatus.Failed;
}
示例14: DeleteTask
/// <summary>
/// Delete a task.
/// </summary>
/// <param name="workspaceSid">Workspace sid.</param>
/// <param name="taskSid">Task sid.</param>
public virtual DeleteStatus DeleteTask(string workspaceSid, string taskSid)
{
Require.Argument("WorkspaceSid", workspaceSid);
Require.Argument("TaskSid", taskSid);
var request = new RestRequest(Method.DELETE);
request.Resource = "Workspaces/{WorkspaceSid}/Tasks/{TaskSid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("TaskSid", taskSid);
var response = Execute(request);
return response.StatusCode == System.Net.HttpStatusCode.NoContent ? DeleteStatus.Success : DeleteStatus.Failed;
}
示例15: DeleteActivity
/// <summary>
/// Delete an activity.
/// </summary>
/// <param name="workspaceSid">Workspace sid.</param>
/// <param name="activitySid">Activity sid.</param>
public virtual DeleteStatus DeleteActivity(string workspaceSid, string activitySid)
{
//Require.Argument("WorkspaceSid", workspaceSid);
//Require.Argument("ActivitySid", activitySid);
var request = new RestRequest(Method.DELETE);
request.Resource = "Workspaces/{WorkspaceSid}/Activities/{ActivitySid}";
request.AddUrlSegment("WorkspaceSid", workspaceSid);
request.AddUrlSegment("ActivitySid", activitySid);
var response = Execute(request);
return response.StatusCode == System.Net.HttpStatusCode.NoContent ? DeleteStatus.Success : DeleteStatus.Failed;
}