<commit_before>package ammo.gateway.protocol;

message AssociateDevice {
  required string device = 1;
  required string user = 2;
  required string key = 3;
}

message AssociateCrossGateway {
  required string gateway_id = 1;
  required string key = 2;
}

message AssociateResult {
  enum Status {
    FAILED = 0;
    SUCCESS = 1;
  }
  required Status result = 1;
  optional string message = 2;
}

enum MessageScope {
  GLOBAL = 0;
  LOCAL = 1;
}

message PushData {
  required string uri = 1;
  optional string mime_type = 2;
  optional bytes data = 3;
  optional string origin_user = 4;
  optional MessageScope scope = 5 [default = GLOBAL];
}

message PullRequest {
  required string request_uid = 1;
  required string plugin_id = 2;
  required string mime_type = 3;
  required string query = 4;
  optional string projection = 5;
  optional uint32 max_results = 6 [default = 0]; //0 means infinite results--  send as many as possible
  optional uint32 start_from_count = 7 [default = 0];
  optional bool live_query = 8 [default = false];
}

message PullResponse {
  required string request_uid = 1;
  required string plugin_id = 2;
  required string mime_type = 3;
  required string uri = 4;
  required bytes data = 5;
}

message RegisterPullInterest {
  required string mime_type = 1;
}

message UnregisterPullInterest {
  required string mime_type = 1;
}

message RegisterDataInterest {
  required string mime_type = 1;
  optional MessageScope scope = 5 [default = GLOBAL];
}

message UnregisterDataInterest {
  required string mime_type = 1;
  optional MessageScope scope = 5 [default = GLOBAL];
}

message GatewayWrapper {
  enum MessageType {
    ASSOCIATE_DEVICE = 0;
    ASSOCIATE_RESULT = 1;
    PUSH_DATA = 2;
    REGISTER_DATA_INTEREST = 3;
    UNREGISTER_DATA_INTEREST = 4;
    PULL_REQUEST = 5;
    PULL_RESPONSE = 6;<commit_msg>Add message scope to pull request and register pull interest messages.  refs #217<commit_after>package ammo.gateway.protocol;

message AssociateDevice {
  required string device = 1;
  required string user = 2;
  required string key = 3;
}

message AssociateCrossGateway {
  required string gateway_id = 1;
  required string key = 2;
}

message AssociateResult {
  enum Status {
    FAILED = 0;
    SUCCESS = 1;
  }
  required Status result = 1;
  optional string message = 2;
}

enum MessageScope {
  GLOBAL = 0;
  LOCAL = 1;
}

message PushData {
  required string uri = 1;
  optional string mime_type = 2;
  optional bytes data = 3;
  optional string origin_user = 4;
  optional MessageScope scope = 5 [default = GLOBAL];
}

message PullRequest {
  required string request_uid = 1;
  required string plugin_id = 2;
  required string mime_type = 3;
  required string query = 4;
  optional string projection = 5;
  optional uint32 max_results = 6 [default = 0]; //0 means infinite results--  send as many as possible
  optional uint32 start_from_count = 7 [default = 0];
  optional bool live_query = 8 [default = false];
  optional MessageScope scope = 9 [default = GLOBAL];
}

message PullResponse {
  required string request_uid = 1;
  required string plugin_id = 2;
  required string mime_type = 3;
  required string uri = 4;
  required bytes data = 5;
}

message RegisterPullInterest {
  required string mime_type = 1;
  optional MessageScope scope = 2 [default = GLOBAL];
}

message UnregisterPullInterest {
  required string mime_type = 1;
  optional MessageScope scope = 2 [default = GLOBAL];
}

message RegisterDataInterest {
  required string mime_type = 1;
  optional MessageScope scope = 5 [default = GLOBAL];
}

message UnregisterDataInterest {
  required string mime_type = 1;
  optional MessageScope scope = 5 [default = GLOBAL];
}

message GatewayWrapper {
  enum MessageType {
    ASSOCIATE_DEVICE = 0;
    ASSOCIATE_RESULT = 1;
    PUSH_DATA = 2;
    REGISTER_DATA_INTEREST = 3;
    UNREGISTER_DATA_INTEREST = 4;
    PULL_REQUEST = 5;
    PULL_RESPONSE = 6;
{'fraction_non_alphanumeric': 0.07474489795918367, 'fraction_numerical': 0.026530612244897958, 'mean_word_length': 3.6734207389749702, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3944259', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1203, 'n_words': 423}