MCPcopy Create free account
hub / github.com/cli/cli / buildUpdateItem

Function buildUpdateItem

pkg/cmd/project/item-edit/item_edit.go:366–398  ·  view source on GitHub ↗
(config editItemConfig, date time.Time)

Source from the content-addressed store, hash-verified

364}
365
366func buildUpdateItem(config editItemConfig, date time.Time) (*UpdateProjectV2FieldValue, map[string]any) {
367 var value githubv4.ProjectV2FieldValue
368 if config.opts.text != "" {
369 value = githubv4.ProjectV2FieldValue{
370 Text: new(githubv4.String(config.opts.text)),
371 }
372 } else if config.opts.numberChanged {
373 value = githubv4.ProjectV2FieldValue{
374 Number: new(githubv4.Float(config.opts.number)),
375 }
376 } else if config.opts.date != "" {
377 value = githubv4.ProjectV2FieldValue{
378 Date: new(githubv4.Date{Time: date}),
379 }
380 } else if config.opts.singleSelectOptionID != "" {
381 value = githubv4.ProjectV2FieldValue{
382 SingleSelectOptionID: new(githubv4.String(config.opts.singleSelectOptionID)),
383 }
384 } else if config.opts.iterationID != "" {
385 value = githubv4.ProjectV2FieldValue{
386 IterationID: new(githubv4.String(config.opts.iterationID)),
387 }
388 }
389
390 return &UpdateProjectV2FieldValue{}, map[string]any{
391 "input": githubv4.UpdateProjectV2ItemFieldValueInput{
392 ProjectID: githubv4.ID(config.opts.projectID),
393 ItemID: githubv4.ID(config.opts.itemID),
394 FieldID: githubv4.ID(config.opts.fieldID),
395 Value: value,
396 },
397 }
398}
399
400func buildClearItem(config editItemConfig) (*ClearProjectV2FieldValue, map[string]any) {
401 return &ClearProjectV2FieldValue{}, map[string]any{

Callers 1

updateItemValuesFunction · 0.85

Calls 1

IDMethod · 0.65

Tested by

no test coverage detected