Skip to content

Commit baf7dc2

Browse files
committed
fix: MIME type now optional in send_input_message
1 parent 1efa7fe commit baf7dc2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/iotics/lib/grpc/circles.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def describe_circle(
3030
circle_did: str,
3131
headers: typing.Optional[common_pb2.Headers] = None
3232
) -> circle_pb2.DescribeCircleResponse:
33-
"""Describes the circle with the given DID, listing its location, properties, and feeds
33+
"""Describes the circle with the given DID, listing its properties
3434
3535
Args:
3636
circle_did: Decentralized Identifier uniquely specifying the circle
@@ -42,7 +42,7 @@ def describe_circle(
4242
req = circle_pb2.DescribeCircleRequest(
4343
headers=headers or create_headers(),
4444
args=circle_pb2.DescribeCircleRequest.Arguments(
45-
circleId=common_pb2.CircleID(id=circle_did)),
45+
circleId=circle_pb2.CircleID(id=circle_did)),
4646
)
4747
return self.stub.DescribeCircle(req)
4848

@@ -62,7 +62,7 @@ def delete_circle(
6262

6363
req = circle_pb2.DeleteCircleRequest(
6464
headers=headers or create_headers(),
65-
args=circle_pb2.DeleteCircleRequest.Arguments(circleId=common_pb2.CircleID(id=circle_did)))
65+
args=circle_pb2.DeleteCircleRequest.Arguments(circleId=circle_pb2.CircleID(id=circle_did)))
6666
return self.stub.DeleteCircle(req)
6767

6868
def list_circles(self,
@@ -107,7 +107,7 @@ def upsert_circle(
107107
req = circle_pb2.UpsertCircleRequest(
108108
headers=headers or create_headers(),
109109
payload=circle_pb2.UpsertCircleRequest.Payload(
110-
circleId=common_pb2.CircleID(id=circle_did),
110+
circleId=circle_pb2.CircleID(id=circle_did),
111111
properties=properties,
112112
)
113113
)

src/iotics/lib/grpc/interest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def send_input_message(
125125
sender_twin_did: str,
126126
receiver_twin_did: str,
127127
input_id: str,
128+
mime_type: str = 'application/json',
128129
remote_host_id: typing.Optional[str] = None,
129130
headers: typing.Optional[common_pb2.Headers] = None,
130131
) -> interest_pb2.SendInputMessageResponse:
@@ -135,6 +136,7 @@ def send_input_message(
135136
sender_twin_did: The twin sending the message
136137
receiver_twin_did: The twin receiving the message
137138
input_id: The ID of the input where the message will be sent
139+
mime_type: The MIME type for the message
138140
remote_host_id: If the receiver twin is remote, its host ID (None if local)
139141
headers: optional request headers
140142
@@ -147,7 +149,7 @@ def send_input_message(
147149
)
148150
input_message = input_pb2.InputMessage(
149151
occurredAt=create_timestamp(),
150-
mime='application/json',
152+
mime=mime_type,
151153
data=json.dumps(message).encode(),
152154
)
153155
request = interest_pb2.SendInputMessageRequest(

0 commit comments

Comments
 (0)