github.com/hyperledger/aries-framework-go@v0.3.2/pkg/didcomm/protocol/messagepickup/models.go (about)

     1  /*
     2  Copyright Scoir Inc. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package messagepickup
     8  
     9  import (
    10  	"time"
    11  
    12  	"github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/decorator"
    13  )
    14  
    15  // StatusRequest sent by the recipient to the message_holder to request a status message./0212-pickup#statusrequest
    16  // https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#statusrequest
    17  type StatusRequest struct {
    18  	Type   string            `json:"@type,omitempty"`
    19  	ID     string            `json:"@id,omitempty"`
    20  	Thread *decorator.Thread `json:"~thread,omitempty"`
    21  }
    22  
    23  // Status details about pending messages
    24  // https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#status
    25  type Status struct {
    26  	Type              string            `json:"@type,omitempty"`
    27  	ID                string            `json:"@id,omitempty"`
    28  	MessageCount      int               `json:"message_count"`
    29  	DurationWaited    int               `json:"duration_waited,omitempty"`
    30  	LastAddedTime     time.Time         `json:"last_added_time,omitempty"`
    31  	LastDeliveredTime time.Time         `json:"last_delivered_time,omitempty"`
    32  	LastRemovedTime   time.Time         `json:"last_removed_time,omitempty"`
    33  	TotalSize         int               `json:"total_size,omitempty"`
    34  	Thread            *decorator.Thread `json:"~thread,omitempty"`
    35  }
    36  
    37  // BatchPickup a request to have multiple waiting messages sent inside a batch message.
    38  // https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#batch-pickup
    39  type BatchPickup struct {
    40  	Type      string            `json:"@type,omitempty"`
    41  	ID        string            `json:"@id,omitempty"`
    42  	BatchSize int               `json:"batch_size"`
    43  	Thread    *decorator.Thread `json:"~thread,omitempty"`
    44  }
    45  
    46  // Batch a message that contains multiple waiting messages.
    47  // https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#batch
    48  type Batch struct {
    49  	Type     string            `json:"@type,omitempty"`
    50  	ID       string            `json:"@id,omitempty"`
    51  	Messages []*Message        `json:"messages~attach"`
    52  	Thread   *decorator.Thread `json:"~thread,omitempty"`
    53  }
    54  
    55  // Message messagepickup wrapper.
    56  type Message struct {
    57  	ID        string    `json:"id"`
    58  	AddedTime time.Time `json:"added_time"`
    59  	Message   []byte    `json:"msg,omitempty"`
    60  }
    61  
    62  // Noop message
    63  // https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#noop
    64  type Noop struct {
    65  	Type string `json:"@type,omitempty"`
    66  	ID   string `json:"@id,omitempty"`
    67  }