@@ -11,6 +11,8 @@ public class EconItems : SteamWebInterface
1111 {
1212 private int appId ;
1313
14+ // The API only exposes certain methods for certain App Ids in the EconItems interface
15+ // I'm hard coding the values for now until I come up with a better, more dynamic solution
1416 private List < int > validSchemaAppIds = new List < int > ( ) ;
1517 private List < int > validSchemaUrlAppIds = new List < int > ( ) ;
1618 private List < int > validStoreMetaDataAppIds = new List < int > ( ) ;
@@ -38,6 +40,7 @@ public EconItems(string steamWebApiKey, int appId)
3840
3941 validStoreMetaDataAppIds . Add ( 440 ) ;
4042 validStoreMetaDataAppIds . Add ( 570 ) ;
43+ validSchemaUrlAppIds . Add ( 730 ) ;
4144
4245 validStoreStatusAppIds . Add ( 440 ) ;
4346 }
@@ -67,15 +70,41 @@ public async Task<SchemaResult> GetSchemaAsync(string language = "")
6770 return schemaResult . Result ;
6871 }
6972
70- public async Task < SchemaUrlResult > GetSchemaUrlAsync ( string language = "" )
73+ public async Task < SchemaUrlResult > GetSchemaUrlAsync ( )
7174 {
7275 if ( ! validSchemaUrlAppIds . Contains ( appId ) )
7376 {
7477 throw new InvalidOperationException ( String . Format ( "AppId {0} is not valid for the GetSchemaUrl method." , appId ) ) ;
7578 }
7679
77- var schemaResult = await CallMethodAsync < SchemaUrlResultContainer > ( "GetSchemaURL" , 1 ) ;
78- return schemaResult . Result ;
80+ var schemaUrlResult = await CallMethodAsync < SchemaUrlResultContainer > ( "GetSchemaURL" , 1 ) ;
81+ return schemaUrlResult . Result ;
82+ }
83+
84+ public async Task < StoreMetaDataResult > GetStoreMetaDataAsync ( string language = "" )
85+ {
86+ if ( ! validStoreMetaDataAppIds . Contains ( appId ) )
87+ {
88+ throw new InvalidOperationException ( String . Format ( "AppId {0} is not valid for the GetStoreMetaData method." , appId ) ) ;
89+ }
90+
91+ List < SteamWebRequestParameter > parameters = new List < SteamWebRequestParameter > ( ) ;
92+
93+ AddToParametersIfHasValue ( "language" , language , parameters ) ;
94+
95+ var storeMetaDataResult = await CallMethodAsync < StoreMetaDataResultContainer > ( "GetStoreMetaData" , 1 ) ;
96+ return storeMetaDataResult . Result ;
97+ }
98+
99+ public async Task < StoreStatusResult > GetStoreStatusAsync ( )
100+ {
101+ if ( ! validStoreStatusAppIds . Contains ( appId ) )
102+ {
103+ throw new InvalidOperationException ( String . Format ( "AppId {0} is not valid for the GetStoreStatus method." , appId ) ) ;
104+ }
105+
106+ var storeStatusResult = await CallMethodAsync < StoreStatusResultContainer > ( "GetStoreStatus" , 1 ) ;
107+ return storeStatusResult . Result ;
79108 }
80109 }
81110}
0 commit comments