本文整理汇总了Golang中github.com/ticketmatic/tm-go/ticketmatic.Client.NewRequest方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.NewRequest方法的具体用法?Golang Client.NewRequest怎么用?Golang Client.NewRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/ticketmatic/tm-go/ticketmatic.Client
的用法示例。
在下文中一共展示了Client.NewRequest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Delete
// Remove an order fee definition
//
// Order fee definitions are archivable: this call won't actually delete the object
// from the database. Instead, it will mark the object as archived, which means it
// won't show up anymore in most places.
//
// Most object types are archivable and can't be deleted: this is needed to ensure
// consistency of historical data.
func Delete(client *ticketmatic.Client, id int64) error {
r := client.NewRequest("DELETE", "/{accountname}/settings/pricing/orderfeedefinitions/{id}")
r.UrlParameters(map[string]interface{}{
"id": id,
})
return r.Run(nil)
}
示例2: Delete
// Remove a contact
//
// Contacts are archivable: this call won't actually delete the object from the
// database. Instead, it will mark the contact as deleted, which means it won't
// show up anymore in most places.
//
// Most object types are archivable and can't be deleted: this is needed to ensure
// consistency of historical data.
func Delete(client *ticketmatic.Client, id int64) error {
r := client.NewRequest("DELETE", "/{accountname}/contacts/{id}")
r.UrlParameters(map[string]interface{}{
"id": id,
})
return r.Run(nil)
}
示例3: Delete
// Remove a phone number type
//
// Phone number types are archivable: this call won't actually delete the object
// from the database. Instead, it will mark the object as archived, which means it
// won't show up anymore in most places.
//
// Most object types are archivable and can't be deleted: this is needed to ensure
// consistency of historical data.
func Delete(client *ticketmatic.Client, id int64) error {
r := client.NewRequest("DELETE", "/{accountname}/settings/system/phonenumbertypes/{id}")
r.UrlParameters(map[string]interface{}{
"id": id,
})
return r.Run(nil)
}
示例4: Delete
// Remove a delivery scenario
//
// Delivery scenarios are archivable: this call won't actually delete the object
// from the database. Instead, it will mark the object as archived, which means it
// won't show up anymore in most places.
//
// Most object types are archivable and can't be deleted: this is needed to ensure
// consistency of historical data.
func Delete(client *ticketmatic.Client, id int64) error {
r := client.NewRequest("DELETE", "/{accountname}/settings/ticketsales/deliveryscenarios/{id}")
r.UrlParameters(map[string]interface{}{
"id": id,
})
return r.Run(nil)
}
示例5: Delete
// Remove a ticket layout
//
// Ticket layouts are archivable: this call won't actually delete the object from
// the database. Instead, it will mark the object as archived, which means it won't
// show up anymore in most places.
//
// Most object types are archivable and can't be deleted: this is needed to ensure
// consistency of historical data.
func Delete(client *ticketmatic.Client, id int64) error {
r := client.NewRequest("DELETE", "/{accountname}/settings/communicationanddesign/ticketlayouts/{id}")
r.UrlParameters(map[string]interface{}{
"id": id,
})
return r.Run(nil)
}
示例6: Unlocktickets
// Unlock a set of tickets for an event (only for events with seatingplans)
//
// Unlock a set of tickets for an event with a seating plan. The unlock call is
// limited to 100 tickets per call.
func Unlocktickets(client *ticketmatic.Client, id int64, data *ticketmatic.EventUnlockTickets) error {
r := client.NewRequest("PUT", "/{accountname}/events/{id}/tickets/unlock")
r.UrlParameters(map[string]interface{}{
"id": id,
})
r.Body(data)
return r.Run(nil)
}
示例7: Batchupdatetickets
// Batch update tickets for an event
//
// Update the contents of one or more custom fields for multiple tickets in one
// call. Batch update is limited to 5000 tickets per call.
//
// Warning: Do not change the barcode of a ticket that has been delivered: existing
// printed tickets will no longer work.
func Batchupdatetickets(client *ticketmatic.Client, id int64, data []*ticketmatic.EventTicket) error {
r := client.NewRequest("PUT", "/{accountname}/events/{id}/tickets/batch")
r.UrlParameters(map[string]interface{}{
"id": id,
})
r.Body(data)
return r.Run(nil)
}
示例8: Export
// Export a query on the public data model
//
// Executes a query against the public data model and exports the results as a
// stream of JSON lines (http://jsonlines.org/): each line contains a JSON object
// which holds one row of the query result.
func Export(client *ticketmatic.Client, data *ticketmatic.QueryRequest) (*QueryStream, error) {
r := client.NewRequest("POST", "/{accountname}/tools/queries/export")
r.Body(data)
stream, err := r.Stream()
if err != nil {
return nil, err
}
return &QueryStream{stream}, nil
}
示例9: Time
// Get the backend time
//
// Returns the current system time, in UTC.
//
// The returned timestamp uses the ISO-8601 format.
//
// This call does not require an Authorization header to be set (it's the only call
// that allows this) and can be used to investigate timestamp issues when trying to
// sign API requests
// (https://www.ticketmatic.com/docs/api/coreconcepts/authentication).
func Time(client *ticketmatic.Client) (*ticketmatic.Timestamp, error) {
r := client.NewRequest("GET", "/{accountname}/diagnostics/time")
var obj *ticketmatic.Timestamp
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
}
示例10: Getlist
// Get the contact fields
//
// Gets the contact fields
func Getlist(client *ticketmatic.Client) (*List, error) {
r := client.NewRequest("GET", "/{accountname}/settings/system/contactfields")
var obj *List
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
}
示例11: Create
// Create a new product category
func Create(client *ticketmatic.Client, data *ticketmatic.ProductCategory) (*ticketmatic.ProductCategory, error) {
r := client.NewRequest("POST", "/{accountname}/settings/productcategories")
r.Body(data)
var obj *ticketmatic.ProductCategory
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
}
示例12: Create
// Create a new contact address type
func Create(client *ticketmatic.Client, data *ticketmatic.ContactAddressType) (*ticketmatic.ContactAddressType, error) {
r := client.NewRequest("POST", "/{accountname}/settings/system/contactaddresstypes")
r.Body(data)
var obj *ticketmatic.ContactAddressType
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
}
示例13: Create
// Create a new sales channel
func Create(client *ticketmatic.Client, data *ticketmatic.SalesChannel) (*ticketmatic.SalesChannel, error) {
r := client.NewRequest("POST", "/{accountname}/settings/ticketsales/saleschannels")
r.Body(data)
var obj *ticketmatic.SalesChannel
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
}
示例14: Reserve
// Reserve order IDs
//
// Importing orders with specified IDs is only possible when those IDs fall in the
// reserved ID range.
//
// Use this call to reserve a range of order IDs. Any ID lower than or equal to the
// specified ID will be reserved. New orders will receive IDs higher than the
// specified ID.
func Reserve(client *ticketmatic.Client, data *ticketmatic.OrderIdReservation) (*ticketmatic.OrderIdReservation, error) {
r := client.NewRequest("POST", "/{accountname}/orders/import/reserve")
r.Body(data)
var obj *ticketmatic.OrderIdReservation
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
}
示例15: Create
// Create a new order fee definition
func Create(client *ticketmatic.Client, data *ticketmatic.OrderFeeDefinition) (*ticketmatic.OrderFeeDefinition, error) {
r := client.NewRequest("POST", "/{accountname}/settings/pricing/orderfeedefinitions")
r.Body(data)
var obj *ticketmatic.OrderFeeDefinition
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
}