github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-supply-chain-master/protos/payload.proto (about) 1 // Copyright 2017 Intel Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // ----------------------------------------------------------------------------- 15 16 syntax = "proto3"; 17 18 import "property.proto"; 19 import "proposal.proto"; 20 21 22 message SCPayload { 23 enum Action { 24 CREATE_AGENT = 0; 25 CREATE_RECORD = 1; 26 FINALIZE_RECORD = 2; 27 CREATE_RECORD_TYPE = 3; 28 UPDATE_PROPERTIES = 4; 29 CREATE_PROPOSAL = 5; 30 ANSWER_PROPOSAL = 6; 31 REVOKE_REPORTER = 7; 32 } 33 34 Action action = 1; 35 36 // Approximately when transaction was submitted, as a Unix UTC 37 // timestamp 38 uint64 timestamp = 2; 39 40 // The transaction handler will read from just one of these fields 41 // according to the Action. 42 CreateAgentAction create_agent = 3; 43 CreateRecordAction create_record = 4; 44 FinalizeRecordAction finalize_record = 5; 45 CreateRecordTypeAction create_record_type = 6; 46 UpdatePropertiesAction update_properties = 7; 47 CreateProposalAction create_proposal = 8; 48 AnswerProposalAction answer_proposal = 9; 49 RevokeReporterAction revoke_reporter = 10; 50 } 51 52 53 message CreateAgentAction { 54 // The human-readable name of the Agent. This does not need to be 55 // unique. 56 string name = 1; 57 } 58 59 60 message CreateRecordAction { 61 // The natural key of the Record 62 string record_id = 1; 63 64 // The name of the RecordType this Record belongs to 65 string record_type = 2; 66 67 repeated PropertyValue properties = 3; 68 } 69 70 71 message FinalizeRecordAction { 72 // The natural key of the Record 73 string record_id = 1; 74 } 75 76 77 message CreateRecordTypeAction { 78 string name = 1; 79 80 repeated PropertySchema properties = 2; 81 } 82 83 84 message UpdatePropertiesAction { 85 // The natural key of the Record 86 string record_id = 1; 87 88 repeated PropertyValue properties = 2; 89 } 90 91 92 message CreateProposalAction { 93 // The natural key of the Record 94 string record_id = 1; 95 96 // the public key of the Agent to whom the Proposal is sent 97 // (must be different from the Agent creating the Proposal) 98 string receiving_agent = 2; 99 100 Proposal.Role role = 3; 101 102 repeated string properties = 4; 103 } 104 105 106 message AnswerProposalAction { 107 enum Response { 108 ACCEPT = 0; 109 REJECT = 1; 110 CANCEL = 2; 111 } 112 113 // The natural key of the Record 114 string record_id = 1; 115 116 // The public key of the Agent to whom the proposal is sent 117 string receiving_agent = 2; 118 119 // The role being proposed (owner, custodian, or reporter) 120 Proposal.Role role = 3; 121 122 // The respose to the Proposal (accept, reject, or cancel) 123 Response response = 4; 124 } 125 126 127 message RevokeReporterAction { 128 // The natural key of the Record 129 string record_id = 1; 130 131 // The reporter's public key 132 string reporter_id = 2; 133 134 // The names of the Properties for which the reporter's 135 // authorization is revoked 136 repeated string properties = 3; 137 }