Chirpstack API adding gateway profile

hey everyone,
I’m trying to add gateway profile using API with Python.

import google.protobuf.duration_pb2 as duration
import grpc
from chirpstack_api.as_pb.external import api
server = “localhost:8080”
api_token = “…”
channel = grpc.insecure_channel(server)
client = api.GatewayProfileServiceStub(channel)
auth_token = [(“authorization”, “Bearer %s” % api_token)]
req = api.CreateGatewayProfileRequest() = “gatewayTEST”
req.gateway_profile.network_server_id = 23
req.gateway_profile.stats_interval = duration.Duration(seconds=60)
resp = client.Create(req,metadata = auth_token)

I got this error,
req.gateway_profile.stats_interval = duration.Duration(seconds=60)
AttributeError: Assignment not allowed to field “stats_interval” in protocol message object.

I’m facing similar things while trying to fill different fields that include other objects (Location … )
If anyone knows what I’m missing here I would appreciate to know.
thank you :slight_smile:

I managed to fix the issue by replacing “req.gateway_profile.stats_interval = duration.Duration(seconds=60)” with “req.gateway_profile.stats_interval.seconds = 60”