本文整理汇总了C#中ZendeskApi_v2.Models.Shared.System类的典型用法代码示例。如果您正苦于以下问题:C# System类的具体用法?C# System怎么用?C# System使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System类属于ZendeskApi_v2.Models.Shared命名空间,在下文中一共展示了System类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Import
/// <summary>
/// This end-point is for bulk importing tickets. It will allow you to
/// move data from legacy systems into Zendesk. We do not run triggers
/// or the likes during bulk imports like these.
/// </summary>
public IndividualTicketResponse Import(TicketImport ticket)
{
var body = new {ticket};
return GenericPost<IndividualTicketResponse>(
String.Format("imports/{0}.json", _tickets),
body);
}
示例2: UpdateTicket
/// <summary>
/// UpdateTicket a ticket or add comments to it. Keep in mind that somethings like the description can't be updated.
/// </summary>
/// <param name="ticket"></param>
/// <param name="comment"></param>
/// <returns></returns>
public IndividualTicketResponse UpdateTicket(Ticket ticket, Comment comment=null)
{
if (comment != null)
ticket.Comment = comment;
var body = new { ticket };
return GenericPut<IndividualTicketResponse>(string.Format("{0}/{1}.json", _tickets, ticket.Id), body);
}
示例3: CreateTicketField
public IndividualTicketFieldResponse CreateTicketField(TicketField ticketField)
{
var body = new
{
ticket_field = new
{
type = ticketField.Type,
title = ticketField.Title
}
};
var res = GenericPost<IndividualTicketFieldResponse>("ticket_fields.json", body);
return res;
}
示例4: GenericBoolPostAsync
public async Task<bool> ChangeUsersPasswordAsync(long userId, string oldPassword, string newPassword)
{
var body = new
{
previous_password = oldPassword,
password = newPassword
};
return await GenericBoolPostAsync(string.Format("users/{0}/password.json", userId), body);
}
示例5: SuspendUserAsync
public async Task<IndividualUserResponse> SuspendUserAsync(long id)
{
var body = new {user = new {suspended = true}};
return await GenericPutAsync<IndividualUserResponse>(string.Format("users/{0}.json", id), body);
}
示例6: CreateUserAsync
public async Task<IndividualUserResponse> CreateUserAsync(User user)
{
var body = new { user = user };
return await GenericPostAsync<IndividualUserResponse>("users.json", body);
}
示例7: UpdateUserIdentity
public IndividualUserIdentityResponse UpdateUserIdentity(long userId, UserIdentity identity)
{
var body = new { identity };
return GenericPost<IndividualUserIdentityResponse>(string.Format("users/{0}/identities.json", userId), body);
}
示例8: SetUsersPassword
public bool SetUsersPassword(long userId, string newPassword)
{
var body = new {password = newPassword};
return GenericBoolPost(string.Format("users/{0}/password.json", userId), body);
}
示例9: SuspendUser
public IndividualUserResponse SuspendUser(long id)
{
var body = new {user = new {suspended = true}};
return GenericPut<IndividualUserResponse>(string.Format("users/{0}.json", id), body);
}
示例10: ReorderTicketForms
public bool ReorderTicketForms(long[] orderedTicketFormIds)
{
var body = new { ticket_form_ids = orderedTicketFormIds };
return GenericPut<bool>(string.Format("{0}/reorder.json", _ticket_forms), body);
}
示例11: ReorderTicketFormsAsync
public async Task<bool> ReorderTicketFormsAsync(long[] orderedTicketFormIds)
{
var body = new { ticket_form_ids = orderedTicketFormIds };
return await GenericPutAsync<bool>(string.Format("{0}/reorder.json", _ticket_forms), body);
}
示例12: CreateTicketFormAsync
public async Task<IndividualTicketFormResponse> CreateTicketFormAsync(TicketForm ticketForm)
{
var body = new { ticket_form = ticketForm };
return await GenericPostAsync<IndividualTicketFormResponse>(_ticket_forms + ".json", body);
}
示例13: UpdateTicketForm
public IndividualTicketFormResponse UpdateTicketForm(TicketForm ticketForm)
{
var body = new { ticket_form = ticketForm};
return GenericPut<IndividualTicketFormResponse>(string.Format("{0}/{1}.json", _ticket_forms, ticketForm.Id), body);
}
示例14: CreateTicketForm
public IndividualTicketFormResponse CreateTicketForm(TicketForm ticketForm)
{
var body = new { ticket_form = ticketForm };
return GenericPost<IndividualTicketFormResponse>(_ticket_forms + ".json", body);
}
示例15: UpdateTicketField
public IndividualTicketFieldResponse UpdateTicketField(TicketField ticketField)
{
var body = new
{
ticket_field = ticketField
};
return GenericPut<IndividualTicketFieldResponse>(string.Format("ticket_fields/{0}.json", ticketField.Id), body);
}